From 6f65ed86bccba9d413fa0f9d5133bdfec6d76018 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 16 May 2018 10:28:56 +0200 Subject: [PATCH] MOBILE-2416 core: Fix blink in reconnect and site policy --- src/core/login/providers/helper.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/core/login/providers/helper.ts b/src/core/login/providers/helper.ts index c295ff14f..a2f704e28 100644 --- a/src/core/login/providers/helper.ts +++ b/src/core/login/providers/helper.ts @@ -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 }); } /**