Skip to content

Commit

Permalink
fix(aepp): call onDetected always with newWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Apr 26, 2023
1 parent 26014b7 commit 80d97fa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/aepp-wallet-communication/wallet-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface Wallets { [key: string]: Wallet }
*/
export default (
connection: BrowserConnection,
onDetected: ({ wallets, newWallet }: { wallets: Wallets; newWallet?: Wallet }) => void,
onDetected: ({ wallets, newWallet }: { wallets: Wallets; newWallet: Wallet }) => void,
): () => void => {
if (window == null) throw new UnsupportedPlatformError('Window object not found, you can run wallet detector only in browser');
const wallets: Wallets = {};
Expand All @@ -49,7 +49,6 @@ export default (
wallets[wallet.info.id] = wallet;
onDetected({ wallets, newWallet: wallet });
}, () => {});
if (Object.keys(wallets).length > 0) onDetected({ wallets });

return () => connection.disconnect();
};

0 comments on commit 80d97fa

Please sign in to comment.