Skip to content

Commit

Permalink
Merge pull request Expensify#42997 from software-mansion-labs/fix-hyb…
Browse files Browse the repository at this point in the history
…rid-init-url

Fix InitialUrlContextProvider for HybridApp #2
  • Loading branch information
AndrewGable authored Jun 3, 2024
2 parents fe32d94 + 5154ef0 commit 174ff97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/InitialURLContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ type InitialURLContextProviderProps = {
function InitialURLContextProvider({children, url}: InitialURLContextProviderProps) {
const [initialURL, setInitialURL] = useState(url);
useEffect(() => {
if (initialURL) {
if (url) {
setInitialURL(url);
return;
}
Linking.getInitialURL().then((initURL) => {
setInitialURL(initURL as Route);
});
}, [initialURL]);
}, [url]);
return <InitialURLContext.Provider value={initialURL}>{children}</InitialURLContext.Provider>;
}

Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function ExitSurveyConfirmPage({exitReason, isLoading, route, navigation}: ExitS
ExitSurvey.switchToOldDot();

if (NativeModules.HybridAppModule) {
Navigation.resetToHome();
NativeModules.HybridAppModule.closeReactNativeApp();
return;
}
Expand Down

0 comments on commit 174ff97

Please sign in to comment.