Skip to content

Commit

Permalink
also clear transactions when editing the current connection's avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Mar 4, 2024
1 parent 867701b commit 9ecebc3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions extension/src/connections/ConnectionsDrawer/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const EditConnection: React.FC<Props> = ({ connectionId, onLaunched }) => {
}

const confirmation = await getConfirmation(
'Switching the piloted Safe will empty your current transaction bundle.'
'Switching the Piloted Safe will empty your current transaction bundle.'
)

if (!confirmation) {
Expand Down Expand Up @@ -217,13 +217,20 @@ const EditConnection: React.FC<Props> = ({ connectionId, onLaunched }) => {
<AvatarInput
availableSafes={safes}
value={avatarAddress}
onChange={(address) =>
updateConnection({
avatarAddress: address,
moduleAddress: '',
moduleType: undefined,
})
}
onChange={async (address) => {
const keepTransactionBundle =
address.toLowerCase() ===
connection.avatarAddress.toLowerCase()
const confirmed =
keepTransactionBundle || (await confirmClearTransactions())
if (confirmed) {
updateConnection({
avatarAddress: address,
moduleAddress: '',
moduleType: undefined,
})
}
}}
/>
</Field>
<Field label="Zodiac Mod" disabled={modules.length === 0}>
Expand Down
2 changes: 1 addition & 1 deletion extension/src/connections/ConnectionsDrawer/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ConnectionItem: React.FC<ConnectionItemProps> = ({
}

const confirmation = await getConfirmation(
'Switching the piloted Safe will empty your current transaction bundle.'
'Switching the Piloted Safe will empty your current transaction bundle.'
)

if (!confirmation) {
Expand Down

0 comments on commit 9ecebc3

Please sign in to comment.