Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test:debug": "TZ=utc NODE_OPTIONS='--inspect-brk --experimental-vm-modules' jest --runInBand",
"perf-test": "NODE_OPTIONS=--experimental-vm-modules npx reassure",
"typecheck": "NODE_OPTIONS=--max_old_space_size=8192 tsc",
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=332 --cache --cache-location=node_modules/.cache/eslint",
"lint": "NODE_OPTIONS=--max_old_space_size=8192 eslint . --max-warnings=330 --cache --cache-location=node_modules/.cache/eslint",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allgandalf Was this done on purpose or its local testing change pushed by mistake ?

"lint-changed": "NODE_OPTIONS=--max_old_space_size=8192 ./scripts/lintChanged.sh",
"lint-watch": "npx eslint-watch --watch --changed",
"shellcheck": "./scripts/shellCheck.sh",
Expand Down
13 changes: 1 addition & 12 deletions src/libs/actions/ExitSurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ import REASON_INPUT_IDS from '@src/types/form/ExitSurveyReasonForm';
import type {ExitReason} from '@src/types/form/ExitSurveyReasonForm';
import RESPONSE_INPUT_IDS from '@src/types/form/ExitSurveyResponseForm';

let exitReason: ExitReason | undefined;
let exitSurveyResponse: string | undefined;
Onyx.connect({
key: ONYXKEYS.FORMS.EXIT_SURVEY_REASON_FORM,
callback: (value) => (exitReason = value?.[REASON_INPUT_IDS.REASON]),
});
Onyx.connect({
key: ONYXKEYS.FORMS.EXIT_SURVEY_RESPONSE_FORM,
callback: (value) => (exitSurveyResponse = value?.[RESPONSE_INPUT_IDS.RESPONSE]),
});

function saveExitReason(reason: ExitReason) {
Onyx.set(ONYXKEYS.FORMS.EXIT_SURVEY_REASON_FORM, {[REASON_INPUT_IDS.REASON]: reason});
}
Expand All @@ -29,7 +18,7 @@ function saveResponse(response: string) {
/**
* Save the user's response to the mandatory exit survey in the back-end.
*/
function switchToOldDot() {
function switchToOldDot(exitReason: ExitReason | undefined, exitSurveyResponse: string | undefined) {
const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.SET,
Expand Down
7 changes: 6 additions & 1 deletion src/pages/settings/ExitSurvey/ExitSurveyConfirmPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type {ExitSurveyReasonForm} from '@src/types/form/ExitSurveyReasonForm';
import EXIT_SURVEY_REASON_INPUT_IDS from '@src/types/form/ExitSurveyReasonForm';
import RESPONSE_INPUT_IDS from '@src/types/form/ExitSurveyResponseForm';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import ExitSurveyOffline from './ExitSurveyOffline';

Expand All @@ -38,6 +39,10 @@ function ExitSurveyConfirmPage({route, navigation}: ExitSurveyConfirmPageProps)
selector: (value: OnyxEntry<ExitSurveyReasonForm>) => value?.[EXIT_SURVEY_REASON_INPUT_IDS.REASON] ?? null,
canBeMissing: true,
});
const [exitSurveyResponse] = useOnyx(ONYXKEYS.FORMS.EXIT_SURVEY_RESPONSE_FORM, {
selector: (value) => value?.[RESPONSE_INPUT_IDS.RESPONSE],
canBeMissing: true,
});
const shouldShowQuickTips =
isEmptyObject(tryNewDot) || tryNewDot?.classicRedirect?.dismissed === true || (!isEmptyObject(tryNewDot) && tryNewDot?.classicRedirect?.dismissed === undefined);

Expand Down Expand Up @@ -90,7 +95,7 @@ function ExitSurveyConfirmPage({route, navigation}: ExitSurveyConfirmPageProps)
text={translate(shouldShowQuickTips ? 'exitSurvey.takeMeToExpensifyClassic' : 'exitSurvey.goToExpensifyClassic')}
pressOnEnter
onPress={() => {
switchToOldDot();
switchToOldDot(exitReason, exitSurveyResponse);
Navigation.dismissModal();
openOldDotLink(CONST.OLDDOT_URLS.INBOX, true);
}}
Expand Down
Loading