Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset request flow when logout #55384

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 15 additions & 1 deletion src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {isMovingTransactionFromTrackExpense as isMovingTransactionFromTrackExpen
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
import {getParticipantsOption, getReportOption} from '@libs/OptionsListUtils';
import {getBankAccountRoute} from '@libs/ReportUtils';
import {generateReportID, getBankAccountRoute} from '@libs/ReportUtils';
import playSound, {SOUNDS} from '@libs/Sound';
import {getDefaultTaxCode, getRateID, getRequestType, getValidWaypoints} from '@libs/TransactionUtils';
import type {GpsPoint} from '@userActions/IOU';
Expand All @@ -39,6 +39,7 @@ import {
setMoneyRequestCategory,
splitBill,
splitBillAndOpenReport,
startMoneyRequest,
startSplitBill,
submitPerDiemExpense as submitPerDiemExpenseIOUActions,
trackExpense as trackExpenseIOUActions,
Expand Down Expand Up @@ -170,6 +171,19 @@ function IOURequestStepConfirmation({
setMoneyRequestBillable(transactionID, defaultBillable);
}, [transactionID, defaultBillable]);

useEffect(() => {
if (transaction?.transactionID) {
return;
}
startMoneyRequest(
CONST.IOU.TYPE.CREATE,
// When starting to create an expense from the global FAB, there is not an existing report yet. A random optimistic reportID is generated and used
// for all of the routes in the creation flow.
generateReportID(),
);
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps -- we don't want this effect to run again
}, []);

useEffect(() => {
if (!transaction?.category) {
return;
Expand Down
Loading