diff --git a/src/app/app.component.ts b/src/app/app.component.ts index bc4d2881f..7457bda23 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -132,16 +132,21 @@ export class AppComponent implements OnInit, AfterViewInit { // Check InAppBrowser closed. CoreEvents.on(CoreEvents.IAB_EXIT, () => { - CoreLoginHelper.setWaitingForBrowser(false); this.lastInAppUrl = ''; - CoreLoginHelper.checkLogout(); + + if (CoreLoginHelper.isWaitingForBrowser()) { + CoreLoginHelper.setWaitingForBrowser(false); + CoreLoginHelper.checkLogout(); + } }); Platform.resume.subscribe(() => { // Wait a second before setting it to false since in iOS there could be some frozen WS calls. setTimeout(() => { - CoreLoginHelper.setWaitingForBrowser(false); - CoreLoginHelper.checkLogout(); + if (CoreLoginHelper.isWaitingForBrowser()) { + CoreLoginHelper.setWaitingForBrowser(false); + CoreLoginHelper.checkLogout(); + } }, 1000); });