Skip to content

Commit 6bbfb63

Browse files
authored
Merge pull request #179 from logangouget/develop
Fix AppStateActiveOnce event listener
2 parents 2892b39 + 8534d8b commit 6bbfb63

File tree

2 files changed

+4
-5690
lines changed

2 files changed

+4
-5690
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ function _waitForRedirectAsync(returnUrl: string): Promise<RedirectResult> {
194194
*/
195195
function AppStateActiveOnce(): Promise<void> {
196196
return new Promise(function (resolve) {
197+
// Browser can be closed before handling AppState change
198+
if (AppState.currentState === 'active') {
199+
return resolve();
200+
}
197201
function _handleAppStateChange(nextAppState: AppStateStatus) {
198202
if (nextAppState === 'active') {
199203
AppState.removeEventListener('change', _handleAppStateChange);

0 commit comments

Comments
 (0)