Skip to content

Commit

Permalink
Don't treat non-existent wallets as if they were connected.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso authored and twhy committed Dec 23, 2023
1 parent 6e78089 commit 93238db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/bases/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export class StateBase {
}

get isWalletOnceConnect() {
return (
this.isWalletConnected || this.isWalletNotExist || this.isWalletError
);
return this.isWalletConnected || this.isWalletError;
}

get isWalletConnecting() {
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export class WalletRepo extends StateBase {
);
return void 0;
}
return this.wallets.find((w) => !w.isWalletDisconnected);
return this.wallets.find(
(w) => !w.isWalletNotExist && !w.isWalletDisconnected
);
}

getWallet = (walletName: WalletName): ChainWalletBase | undefined => {
Expand Down

0 comments on commit 93238db

Please sign in to comment.