diff --git a/src/libs/actions/ExitSurvey.ts b/src/libs/actions/ExitSurvey.ts index ef3ecd6d3e31..67ac39d81bd6 100644 --- a/src/libs/actions/ExitSurvey.ts +++ b/src/libs/actions/ExitSurvey.ts @@ -65,7 +65,8 @@ function switchToOldDot() { }, ]; - API.write( + // eslint-disable-next-line rulesdir/no-api-side-effects-method + return API.makeRequestWithSideEffects( 'SwitchToOldDot', { reason: exitReason, diff --git a/src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx b/src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx index 7507e1015f86..db9f3199954f 100644 --- a/src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx +++ b/src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx @@ -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}