MOBILE-2416 core: Fix blink in reconnect and site policy

main
Dani Palou 2018-05-16 10:28:56 +02:00
parent e80f5a1301
commit 6f65ed86bc
1 changed files with 18 additions and 2 deletions

View File

@ -876,7 +876,15 @@ export class CoreLoginHelperProvider {
} else {
const info = currentSite.getInfo();
if (typeof info != 'undefined' && typeof info.username != 'undefined') {
this.appProvider.getRootNavController().setRoot('CoreLoginReconnectPage', {
const rootNavCtrl = this.appProvider.getRootNavController(),
activePage = rootNavCtrl.getActive();
// If current page is already reconnect, stop.
if (activePage && activePage.component && activePage.component.name == 'CoreLoginReconnectPage') {
return;
}
rootNavCtrl.setRoot('CoreLoginReconnectPage', {
infoSiteUrl: info.siteurl,
siteUrl: result.siteUrl,
siteId: siteId,
@ -924,7 +932,15 @@ export class CoreLoginHelperProvider {
return;
}
this.appProvider.getRootNavController().setRoot('CoreLoginSitePolicyPage', { siteId: siteId });
const rootNavCtrl = this.appProvider.getRootNavController(),
activePage = rootNavCtrl.getActive();
// If current page is already site policy, stop.
if (activePage && activePage.component && activePage.component.name == 'CoreLoginSitePolicyPage') {
return;
}
rootNavCtrl.setRoot('CoreLoginSitePolicyPage', { siteId: siteId });
}
/**