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

Commit

Permalink
Fix modal not triggering cancel function on close
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenbf committed Apr 4, 2024
1 parent 3004b8c commit c7af889
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build": "tsc"
},
"dependencies": {
"@concordium/wallet-connectors": "^0.6.0-alpha.4"
"@concordium/wallet-connectors": "^0.6.0-alpha.5"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-connectors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@concordium/wallet-connectors",
"version": "0.6.0-alpha.4",
"version": "0.6.0-alpha.5",
"description": "Utility interface for dApps to interact with wallets without depending on the underlying protocol and implementations for Concordium Browser Wallet and Wallet Connect v2.",
"author": "Concordium Software",
"license": "Apache-2.0",
Expand Down
11 changes: 8 additions & 3 deletions packages/wallet-connectors/src/WalletConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,13 @@ async function connect(
walletImages,
enableExplorer,
});
modal.subscribeModal(({ open }) => {
if (!open) {
return cancel();
}
});
// Open modal as we're not connecting to an existing pairing.
modal.openModal({ uri });
await modal.openModal({ uri });
}
return await approval();
} catch (e) {
Expand Down Expand Up @@ -552,8 +557,8 @@ export class WalletConnectConnector implements WalletConnector {
this.network === MAINNET
? [cryptoXWalletMainnet, concordiumWalletMainnet]
: this.network === TESTNET
? [cryptoXWalletTestnet, concordiumWalletTestnet]
: undefined
? [cryptoXWalletTestnet, concordiumWalletTestnet]
: undefined
);
}

Expand Down

0 comments on commit c7af889

Please sign in to comment.