From ecd67bc6279f951552bdc388c0d11a7a19cb1532 Mon Sep 17 00:00:00 2001 From: keeri Date: Mon, 13 Dec 2021 15:07:19 +0000 Subject: [PATCH] fix condition being checked outside timeout callback --- .../account-details.component.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/components/account-details/account-details.component.ts b/src/app/components/account-details/account-details.component.ts index dbf9c20..92903ca 100644 --- a/src/app/components/account-details/account-details.component.ts +++ b/src/app/components/account-details/account-details.component.ts @@ -394,19 +394,19 @@ export class AccountDetailsComponent implements OnInit, OnDestroy { clearTimeout(this.timeoutIdQueuedAutoRefresh); } - if (this.autoRefreshReasonBlockUpdate !== null) { - const isUpdateStillRelevant = - this.isReceivableBlockUpdateRelevant(this.autoRefreshReasonBlockUpdate); - - if (isUpdateStillRelevant === false) { - this.enableRefreshesEventually(); - return; - } - } - this.timeoutIdQueuedAutoRefresh = setTimeout( () => { + if (this.autoRefreshReasonBlockUpdate !== null) { + const isUpdateStillRelevant = + this.isReceivableBlockUpdateRelevant(this.autoRefreshReasonBlockUpdate); + + if (isUpdateStillRelevant === false) { + this.enableRefreshesEventually(); + return; + } + } + this.loadAccountDetails(); }, delayMS