diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-05-11 21:47:35 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-05-11 21:47:35 +0530 |
commit | 857a2b9dcaf64d4298027644f8e6716fa22db941 (patch) | |
tree | dc711c998d153a5f3169e71c851adbf5d7ad12ec /src/webex | |
parent | 277a513a8f9c46392446514e7a37e77e4f4b5327 (diff) | |
download | wallet-core-857a2b9dcaf64d4298027644f8e6716fa22db941.tar.xz |
perf: reserve history in separate object store
Diffstat (limited to 'src/webex')
-rw-r--r-- | src/webex/pages/popup.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx index 450aae4ce..4d3c65b26 100644 --- a/src/webex/pages/popup.tsx +++ b/src/webex/pages/popup.tsx @@ -177,6 +177,7 @@ class WalletBalanceView extends React.Component<any, any> { private gotError = false; private canceler: (() => void) | undefined = undefined; private unmount = false; + private updateBalanceRunning = false; componentWillMount(): void { this.canceler = wxApi.onUpdateNotification(() => this.updateBalance()); @@ -192,6 +193,10 @@ class WalletBalanceView extends React.Component<any, any> { } async updateBalance(): Promise<void> { + if (this.updateBalanceRunning) { + return; + } + this.updateBalanceRunning = true; let balance: WalletBalance; try { balance = await wxApi.getBalance(); @@ -203,6 +208,8 @@ class WalletBalanceView extends React.Component<any, any> { console.error("could not retrieve balances", e); this.setState({}); return; + } finally { + this.updateBalanceRunning = false; } if (this.unmount) { return; |