Skip to content

Commit 9c51739

Browse files
committed
Show GPS warning before loading-state guard blocks HybridApp exit
1 parent 992fb32 commit 9c51739

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/libs/actions/HybridApp/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import HybridAppModule from '@expensify/react-native-hybrid-app';
22
import Onyx from 'react-native-onyx';
33
import type {OnyxEntry} from 'react-native-onyx';
44
import Navigation from '@libs/Navigation/Navigation';
5-
import {shouldBlockOldAppExit} from '@libs/TryNewDotUtils';
5+
import {isLockedToNewApp, shouldBlockOldAppExit} from '@libs/TryNewDotUtils';
66
import {setIsGPSInProgressModalOpen} from '@userActions/isGPSInProgressModalOpen';
77
import CONFIG from '@src/CONFIG';
88
import ONYXKEYS from '@src/ONYXKEYS';
@@ -84,7 +84,7 @@ function getHybridAppSettings(): Promise<HybridAppSettings | null> {
8484
}
8585

8686
function closeReactNativeApp({shouldSetNVP, isTrackingGPS}: {shouldSetNVP: boolean; isTrackingGPS: boolean}) {
87-
if (shouldBlockOldAppExit(currentTryNewDot, isLoadingTryNewDot, shouldSetNVP)) {
87+
if (isLockedToNewApp(currentTryNewDot)) {
8888
return;
8989
}
9090

@@ -93,6 +93,10 @@ function closeReactNativeApp({shouldSetNVP, isTrackingGPS}: {shouldSetNVP: boole
9393
return;
9494
}
9595

96+
if (shouldBlockOldAppExit(currentTryNewDot, isLoadingTryNewDot, shouldSetNVP)) {
97+
return;
98+
}
99+
96100
Navigation.clearPreloadedRoutes();
97101
if (CONFIG.IS_HYBRID_APP) {
98102
Onyx.merge(ONYXKEYS.HYBRID_APP, {closingReactNativeApp: true});

0 commit comments

Comments
 (0)