Skip to content

Commit

Permalink
fix: 🐛 fix infinite reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideSegullo committed Jun 6, 2024
1 parent 39806bf commit 8529f73
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/stores/src/account/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,20 @@ export class AccountStore<Injects extends Record<string, any>[] = []> {
}
);

this._walletManager.on("refresh_connection", () => {
this.refresh();
});

this._walletManager.setActions({
viewWalletRepo: () => this.refresh(),
data: () => this.refresh(),
state: () => this.refresh(),
message: () => this.refresh(),
});
this._walletManager.walletRepos.forEach((repo) => {
repo.setActions({
/* repo.setActions({
viewWalletRepo: () => this.refresh(),
});
}); */
repo.wallets.forEach((wallet) => {
wallet.updateCallbacks({
...wallet.callbacks,
Expand Down Expand Up @@ -312,13 +316,7 @@ export class AccountStore<Injects extends Record<string, any>[] = []> {
if (!this._refreshing) {
this._refreshing = true;
this._refreshRequests++;

/**
* Here we add some debounce
*/
setTimeout(() => {
this._refreshing = false;
}, 100);
this._refreshing = false;
}
}

Expand Down

0 comments on commit 8529f73

Please sign in to comment.