Skip to content

Commit

Permalink
Merge pull request #23 from Conflux-Chain/fix/detect-wallet
Browse files Browse the repository at this point in the history
feat: resolve detect while retry limit reached
  • Loading branch information
mosshqq authored Nov 14, 2024
2 parents 976392d + 6e54142 commit 0fd0486
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/base/src/emitter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class Emitter<T extends RPCMethod> {
if (this.RPCMethod.sessionKey) {
const times = Number(sessionStorage.getItem(this.RPCMethod.sessionKey) || 0);
if (times >= this.RPCMethod.retryLimit) {
this.handleStatusChanged('not-active');
this.resolveDetect();
throw new Error(`detect ${this.RPCMethod.sessionKey ? 'window.' + this.RPCMethod.sessionKey.split('-')[0] : 'wallet'} timeout.`);
}
sessionStorage.setItem(this.RPCMethod.sessionKey, String(times + 1));
Expand Down

0 comments on commit 0fd0486

Please sign in to comment.