MOBILE-3320 core: Fix cancel reconnect when app is resumed

main
Dani Palou 2021-06-03 15:47:01 +02:00
parent 34b2a1f565
commit aebedbd150
1 changed files with 9 additions and 4 deletions

View File

@ -132,16 +132,21 @@ export class AppComponent implements OnInit, AfterViewInit {
// Check InAppBrowser closed.
CoreEvents.on(CoreEvents.IAB_EXIT, () => {
CoreLoginHelper.setWaitingForBrowser(false);
this.lastInAppUrl = '';
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(() => {
if (CoreLoginHelper.isWaitingForBrowser()) {
CoreLoginHelper.setWaitingForBrowser(false);
CoreLoginHelper.checkLogout();
}
}, 1000);
});