Skip to content

Commit 545951c

Browse files
committed
Fix GPS switch modal around TryNewDot loading
1 parent 9c51739 commit 545951c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/components/GPSInProgressModal/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function GPSInProgressModal() {
1515
const stopGpsAndSwitchToOD = async () => {
1616
setIsGPSInProgressModalOpen(false);
1717
await stopGpsTrip(isOffline);
18-
closeReactNativeApp({shouldSetNVP: true, isTrackingGPS: false});
18+
closeReactNativeApp({shouldSetNVP: true, isTrackingGPS: false, shouldIgnoreTryNewDotLoading: true});
1919
};
2020

2121
return (

src/libs/actions/HybridApp/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ function getHybridAppSettings(): Promise<HybridAppSettings | null> {
8383
});
8484
}
8585

86-
function closeReactNativeApp({shouldSetNVP, isTrackingGPS}: {shouldSetNVP: boolean; isTrackingGPS: boolean}) {
86+
type CloseReactNativeAppParams = {
87+
shouldSetNVP: boolean;
88+
isTrackingGPS: boolean;
89+
shouldIgnoreTryNewDotLoading?: boolean;
90+
};
91+
92+
function closeReactNativeApp({shouldSetNVP, isTrackingGPS, shouldIgnoreTryNewDotLoading = false}: CloseReactNativeAppParams) {
8793
if (isLockedToNewApp(currentTryNewDot)) {
8894
return;
8995
}
@@ -93,7 +99,7 @@ function closeReactNativeApp({shouldSetNVP, isTrackingGPS}: {shouldSetNVP: boole
9399
return;
94100
}
95101

96-
if (shouldBlockOldAppExit(currentTryNewDot, isLoadingTryNewDot, shouldSetNVP)) {
102+
if (!shouldIgnoreTryNewDotLoading && shouldBlockOldAppExit(currentTryNewDot, isLoadingTryNewDot, shouldSetNVP)) {
97103
return;
98104
}
99105

0 commit comments

Comments
 (0)