Skip to content

Commit

Permalink
Merge pull request #43275 from software-mansion-labs/fix-switch-to-od
Browse files Browse the repository at this point in the history
[HybridApp] Change `switchToOldDot` to return a promise
  • Loading branch information
AndrewGable authored Jun 7, 2024
2 parents 617426b + 6ed95d1 commit 9c5bf21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/libs/actions/ExitSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function switchToOldDot() {
},
];

API.write(
// eslint-disable-next-line rulesdir/no-api-side-effects-method
return API.makeRequestWithSideEffects(
'SwitchToOldDot',
{
reason: exitReason,
Expand Down
17 changes: 8 additions & 9 deletions src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ function ExitSurveyConfirmPage({exitReason, isLoading, route, navigation}: ExitS
large
text={translate('exitSurvey.goToExpensifyClassic')}
onPress={() => {
ExitSurvey.switchToOldDot();

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

Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
ExitSurvey.switchToOldDot().then(() => {
if (NativeModules.HybridAppModule) {
Navigation.resetToHome();
NativeModules.HybridAppModule.closeReactNativeApp();
return;
}
Link.openOldDotLink(CONST.OLDDOT_URLS.INBOX);
});
}}
isLoading={isLoading ?? false}
isDisabled={isOffline}
Expand Down

0 comments on commit 9c5bf21

Please sign in to comment.