Skip to content

Commit 2a2530c

Browse files
committed
fix condition
1 parent ba687b4 commit 2a2530c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/ScreenWrapper/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ function ScreenWrapper(
173173
const [isSingleNewDotEntry] = useOnyx(ONYXKEYS.IS_SINGLE_NEW_DOT_ENTRY, {canBeMissing: true});
174174
const {setRootStatusBarEnabled} = useContext(CustomStatusBarAndBackgroundContext);
175175

176-
usePreventRemove((isSingleNewDotEntry ?? false) && initialURL === Navigation.getActiveRouteWithoutParams(), () => {
177-
if (!CONFIG.IS_HYBRID_APP) {
176+
usePreventRemove(true, () => {
177+
const shouldGoToOD = (isSingleNewDotEntry ?? false) && initialURL === Navigation.getActiveRouteWithoutParams();
178+
if (!CONFIG.IS_HYBRID_APP || !shouldGoToOD) {
178179
return;
179180
}
180181
HybridAppModule.closeReactNativeApp({shouldSignOut: false, shouldSetNVP: false});

0 commit comments

Comments
 (0)