From 4ef18b7ec51ea66c06dc4dba2650e2661fb49b77 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 10 Jun 2020 11:40:12 +0200 Subject: [PATCH] MOBILE-3401 login: Prevent reconnect page created several times --- src/core/login/providers/helper.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/login/providers/helper.ts b/src/core/login/providers/helper.ts index e70e11370..e9114023e 100644 --- a/src/core/login/providers/helper.ts +++ b/src/core/login/providers/helper.ts @@ -83,6 +83,7 @@ export class CoreLoginHelperProvider { protected isSSOConfirmShown = false; protected isOpenEditAlertShown = false; protected pageToLoad: {page: string, params: any, time: number}; // Page to load once main menu is opened. + protected isOpeningReconnect = false; waitingForBrowser = false; constructor(logger: CoreLoggerProvider, private sitesProvider: CoreSitesProvider, private domUtils: CoreDomUtilsProvider, @@ -1135,7 +1136,7 @@ export class CoreLoginHelperProvider { } const info = currentSite.getInfo(); - if (typeof info != 'undefined' && typeof info.username != 'undefined') { + if (typeof info != 'undefined' && typeof info.username != 'undefined' && !this.isOpeningReconnect) { const rootNavCtrl = this.appProvider.getRootNavController(), activePage = rootNavCtrl.getActive(); @@ -1144,6 +1145,8 @@ export class CoreLoginHelperProvider { return; } + this.isOpeningReconnect = true; + rootNavCtrl.setRoot('CoreLoginReconnectPage', { infoSiteUrl: info.siteurl, siteUrl: result.siteUrl, @@ -1151,6 +1154,8 @@ export class CoreLoginHelperProvider { pageName: data.pageName, pageParams: data.params, siteConfig: result.config + }).finally(() => { + this.isOpeningReconnect = false; }); } }