Skip to content

Commit

Permalink
fix: send confirmation after interaction cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidsowardx committed Jun 13, 2024
1 parent aee11a2 commit 84ff1fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/chrome/messages/message-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const MessageClient = (
mergeMap(({ message, tabId }) =>
handler(message, sendMessageAndWaitForConfirmation, tabId)
.andThen((result) =>
result.sendConfirmation
result?.sendConfirmation
? sendConfirmationSuccess({
origin,
messageId: message.messageId,
Expand Down
4 changes: 1 addition & 3 deletions src/chrome/offscreen/wallet-connection/message-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export const WalletConnectionMessageHandler = (input: {
// Message from wallet to extension (incldues ledger, dApp and accountList message)
case messageDiscriminator.walletMessage: {
if (isLedgerRequest(message.data)) {
logger.debug('🪪 -> 📒: walletToLedgerSubject', message.data)

return sendMessageWithConfirmation(
createMessage.walletToLedger(
'offScreen',
Expand All @@ -68,7 +66,6 @@ export const WalletConnectionMessageHandler = (input: {
),
).map(() => ({ sendConfirmation: false }))
} else if (isExtensionMessage(message.data)) {
logger.debug('Wallet to extension', message.data)
return sendMessageWithConfirmation(
createMessage.walletToExtension(
'offScreen',
Expand Down Expand Up @@ -100,6 +97,7 @@ export const WalletConnectionMessageHandler = (input: {
tabId,
),
)
.map(() => ({ sendConfirmation: true }))
}

// Message from dApp to wallet
Expand Down
1 change: 0 additions & 1 deletion src/pairing/state/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export const useConnectionsClient = () => {
)

useEffect(() => {
logger.debug('Connections updated', connections)
setConnectionsClient(ConnectionsClient(connections))
}, [connections])

Expand Down

0 comments on commit 84ff1fb

Please sign in to comment.