Merge pull request #8068 from gabrielbazan7/fix/scanner1

Fix: camera remains active
This commit is contained in:
Gabriel Masclef 2018-02-19 10:10:33 -03:00 committed by GitHub
commit 5de11aede8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 54 additions and 39 deletions

View File

@ -96,8 +96,9 @@ export class CopayersPage {
this.onGoingProcessProvider.set('deletingWallet', false);
this.pushNotificationsProvider.unsubscribe(this.wallet);
this.navCtrl.popToRoot();
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot().then(() => {
this.navCtrl.parent.select(0);
});
}).catch((err: any) => {
this.onGoingProcessProvider.set('deletingWallet', false);
let errorText = this.translate.instant('Error');

View File

@ -213,8 +213,9 @@ export class ImportWalletPage {
this.navCtrl.popToRoot();
}
else {
this.navCtrl.popToRoot();
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot().then(() => {
this.navCtrl.parent.select(0);
});
}
}).catch((err: any) => {
this.logger.warn(err);
@ -373,8 +374,9 @@ export class ImportWalletPage {
if (this.navParams.data.fromScan) {
this.navCtrl.popToRoot({ animate: false });
} else {
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(2);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(2);
});
}
}

View File

@ -169,8 +169,9 @@ export class JoinWalletPage {
if (this.navParams.data.fromScan) {
this.navCtrl.popToRoot({ animate: false });
} else {
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(2);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(2);
});
}
}

View File

@ -62,8 +62,9 @@ export class CoinbaseSettingsPage {
).then((res) => {
if (res) {
this.coinbaseProvider.logout();
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
}
});
};

View File

@ -51,8 +51,9 @@ export class GlideraSettingsPage {
).then((res) => {
if (res) {
this.glideraProvider.remove();
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
}
});
}

View File

@ -86,7 +86,7 @@ export class ConfirmPage {
this.config = this.configProvider.get();
this.configFeeLevel = this.config.wallet.settings.feeLevel ? this.config.wallet.settings.feeLevel : 'normal';
this.isCordova = this.platformProvider.isCordova;
this.isWindowsPhoneApp = this.platformProvider.isCordova && this.platformProvider.isWP;
this.isWindowsPhoneApp = this.platformProvider.isCordova && this.platformProvider.isWP;
}
ionViewWillEnter() {
@ -619,8 +619,9 @@ export class ConfirmPage {
let modal = this.modalCtrl.create(SuccessModalPage, params, { showBackdrop: true, enableBackdropDismiss: false });
modal.present();
modal.onDidDismiss(() => {
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
})
}

View File

@ -179,8 +179,9 @@ export class BitcoinCashPage {
if (isNew)
this.walletProvider.startScan(newWallet);
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
});
}).catch((err) => {
this.onGoingProcessProvider.set('duplicatingWallet', false);

View File

@ -155,8 +155,9 @@ export class WalletAddressesPage {
public scan(): void {
this.walletProvider.startScan(this.wallet);
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.push(WalletDetailsPage, { walletId: this.wallet.credentials.walletId })
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
this.navCtrl.push(WalletDetailsPage, { walletId: this.wallet.credentials.walletId });
});
}
}

View File

@ -55,8 +55,9 @@ export class WalletDeletePage {
this.events.publish('status:updated');
this.onGoingProcessProvider.set('deletingWallet', false);
this.pushNotificationsProvider.unsubscribe(this.wallet);
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
}).catch((err) => {
this.popupProvider.ionicAlert(this.translate.instant('Error'), err.message || err);
});

View File

@ -157,8 +157,9 @@ export class WalletExportPage {
};
this.backupProvider.walletDownload(this.exportWalletForm.value.password, opts, this.navParams.data.walletId).then(() => {
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
}).catch((err: string) => {
this.popupProvider.ionicAlert(this.translate.instant('Error'), this.translate.instant('Failed to export'));
});

View File

@ -89,8 +89,9 @@ export class WalletInformationPage {
opts.colorFor[this.wallet.credentials.walletId] = color;
this.configProvider.set(opts);
this.events.publish('wallet:updated', this.wallet.credentials.walletId);
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
});
};
public openWalletExtendedPrivateKey(): void {

View File

@ -90,9 +90,10 @@ export class WalletServiceUrlPage {
this.configProvider.set(opts);
this.persistenceProvider.setCleanAndScanAddresses(this.wallet.credentials.walletId);
this.events.publish('wallet:updated', this.wallet.credentials.walletId);
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.reload();
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
this.reload();
});
};
private reload(): void {

View File

@ -173,9 +173,10 @@ export class WalletTransactionHistoryPage {
this.logger.info('Transaction history cleared for :' + this.wallet.id);
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
this.navCtrl.push(WalletDetailsPage, { walletId: this.wallet.credentials.walletId, clearCache: true });
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
this.navCtrl.push(WalletDetailsPage, { walletId: this.wallet.credentials.walletId, clearCache: true });
});
}
}

View File

@ -153,12 +153,13 @@ export class PushNotificationsProvider {
if (!wallet) return;
this.navCtrl = this.app.getActiveNav();
this.navCtrl.popToRoot({ animate: false });
this.navCtrl.parent.select(0);
if (!wallet.isComplete()) {
this.navCtrl.push(CopayersPage, { walletId: wallet.credentials.walletId });
return;
}
this.navCtrl.push(WalletDetailsPage, { walletId: wallet.credentials.walletId });
this.navCtrl.popToRoot({ animate: false }).then(() => {
this.navCtrl.parent.select(0);
if (!wallet.isComplete()) {
this.navCtrl.push(CopayersPage, { walletId: wallet.credentials.walletId });
return;
}
this.navCtrl.push(WalletDetailsPage, { walletId: wallet.credentials.walletId });
});
}
}