Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: drop request when cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
xstelea committed Aug 11, 2023
1 parent 6c15656 commit 40de5dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { createLogger } from '../lib/helpers/logger'

const sdk = WalletSdk({
dAppDefinitionAddress:
'account_tdx_a_1qd5svul20u30qnq408zhj2tw5evqrunq48eg0jsjf9qsx5t8qu',
'account_tdx_d_12y9wptk69gxnfqrm4gepcu4apuscc8z4v5pvurfr3tcmtjl29a2wjn',
logger: createLogger(1),
networkId: 12,
networkId: 13,
})

document.getElementById('open-popup-btn')!.onclick = async () => {
Expand Down
7 changes: 6 additions & 1 deletion lib/connector-extension/connector-extension-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export const ConnectorExtensionClient = (
map((message) => {
const error = createSdkError('canceledByUser', message.interactionId)
logger?.debug(`🔵⬆️❌ walletRequestCanceled`, error)
cancelRequestSubject.next(err(error))
return message
})
)
Expand All @@ -119,6 +118,12 @@ export const ConnectorExtensionClient = (
metadata: walletInteraction.metadata,
})

setTimeout(() => {
cancelRequestSubject.next(
err(createSdkError('canceledByUser', walletInteraction.interactionId))
)
})

return ResultAsync.fromSafePromise(
firstValueFrom(
merge(
Expand Down

0 comments on commit 40de5dc

Please sign in to comment.