Skip to content

Commit

Permalink
Merge pull request #11858 from JohnathanWhite/fix/swap-remove-nav-check
Browse files Browse the repository at this point in the history
[FIX] swap - remove nav check from check confirmation
  • Loading branch information
Gamboster authored Sep 1, 2021
2 parents b6ed0a8 + f45d85a commit d92d86c
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/pages/exchange-crypto/exchange-crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,16 @@ export class ExchangeCryptoPage {

this.getExchangesCurrencies();
this.onPauseSubscription = this.platform.pause.subscribe(() => {
this.logger.debug('Swap - onPauseSubscription called');
if (this.timeout) {
this.logger.debug('Swap - onPauseSubscription clearing timeout');
clearTimeout(this.timeout);
}
});
this.onResumeSubscription = this.platform.resume.subscribe(() => {
this.logger.debug('Swap - onResumeSubscription called');
if (this.exchangeToUse == '1inch' && !this.fromWalletAllowanceOk) {
this.logger.debug('Swap - onResumeSubscription checking Confirmation');
this.checkConfirmation(1000);
}
});
Expand Down Expand Up @@ -1245,24 +1249,8 @@ export class ExchangeCryptoPage {
}

private checkConfirmation(ms: number) {
const currentIndex = this.navCtrl.getActive().index;
const currentView = this.navCtrl.getViews();

if (
this.fromWalletSelected &&
[
'ExchangeCryptoPage',
'ExchangeCryptoSettingsPage',
'OneInchPage'
].includes(currentView[currentIndex].name)
) {
this.timeout = setTimeout(
() => {
this.verifyAllowances();
},
ms ? ms : 15000
);
}
this.logger.debug('Swap - checking confirmation');
this.timeout = setTimeout(() => this.verifyAllowances(), ms || 15000);
}

private verifyAllowances() {
Expand Down

0 comments on commit d92d86c

Please sign in to comment.