Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
176dd66
feat: report field
koko57 Oct 14, 2025
49aaf64
feat: show category field on iou
koko57 Oct 14, 2025
61e6e98
fix: resolve conflicts
koko57 Oct 15, 2025
f41b418
fix: handle changing report when creating a new one
koko57 Oct 16, 2025
9bbcbaf
fix: category navigation
koko57 Oct 16, 2025
3fdeb30
fix: revert changes for editing report
koko57 Oct 16, 2025
b8e4702
fix: navigate issue after workspace selection
koko57 Oct 16, 2025
8655eab
fix: resolve conflicts
koko57 Oct 16, 2025
dfdcdae
fix: remove comment
koko57 Oct 16, 2025
dfbf5ee
fix: minor change
koko57 Oct 16, 2025
ae5f19f
fix: resolve conflicts
koko57 Oct 16, 2025
7d1e2d7
fix: added a Log.hmm in case of missing navigateTo param
MrMuzyk Oct 17, 2025
4d1a4df
fix: resolve conflicts
koko57 Oct 22, 2025
4fc6dae
fix: restore screen config, do not show the field when category not e…
koko57 Oct 22, 2025
449560e
fix: navigate back when no categories enabled on selected workspace
koko57 Oct 22, 2025
3480921
fix: resolve conflicts
koko57 Oct 23, 2025
3cba7ea
fix: prettier
koko57 Oct 23, 2025
e0198fe
fix: resolve conflicts
koko57 Oct 23, 2025
a3155ab
fix: typo
koko57 Oct 23, 2025
52537c3
fix: get default policy to show the category field
koko57 Oct 23, 2025
a57a5d4
fix: resolve conflicts
koko57 Oct 23, 2025
f522bb6
fix: apply requested changes
koko57 Oct 23, 2025
00029e0
fix: change condition to show the category field
koko57 Oct 23, 2025
fd9dd84
fix: remove console log
koko57 Oct 23, 2025
425e9ac
fix: 73360
MrMuzyk Oct 24, 2025
8e4fb97
fix: 73321
MrMuzyk Oct 27, 2025
affddd5
Merge branch 'main' of https://github.com/Expensify/App into feat/717…
MrMuzyk Oct 27, 2025
31cd097
fix: fetch draft workspace when creating track expense
MrMuzyk Oct 27, 2025
78d329d
Merge branch 'main' of https://github.com/Expensify/App into feat/717…
MrMuzyk Oct 28, 2025
30b765b
fix: change id we are passing
MrMuzyk Oct 28, 2025
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
3 changes: 1 addition & 2 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,7 @@ const ROUTES = {
},
SET_DEFAULT_WORKSPACE: {
route: 'set-default-workspace',
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getRoute: (backTo?: string) => getUrlWithBackToParam('set-default-workspace', backTo),
getRoute: (navigateTo?: string) => (navigateTo ? (`set-default-workspace?navigateTo=${encodeURIComponent(navigateTo)}` as const) : ('set-default-workspace' as const)),
},
REPORT: 'r',
REPORT_WITH_ID: {
Expand Down
8 changes: 7 additions & 1 deletion src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useLocalize from '@hooks/useLocalize';
import {MouseProvider} from '@hooks/useMouseContext';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
import usePreferredPolicy from '@hooks/usePreferredPolicy';
import usePrevious from '@hooks/usePrevious';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -323,8 +324,13 @@ function MoneyRequestConfirmationList({
const prevCurrency = usePrevious(currency);
const prevSubRates = usePrevious(subRates);

const isTrackExpense = iouType === CONST.IOU.TYPE.TRACK;
const {shouldSelectPolicy} = usePolicyForMovingExpenses();

// A flag for showing the categories field
const shouldShowCategories = (isPolicyExpenseChat || isTypeInvoice) && (!!iouCategory || hasEnabledOptions(Object.values(policyCategories ?? {})));
const shouldShowCategories = isTrackExpense
? !policy || shouldSelectPolicy || hasEnabledOptions(Object.values(policyCategories ?? {}))
: (isPolicyExpenseChat || isTypeInvoice) && (!!iouCategory || hasEnabledOptions(Object.values(policyCategories ?? {})));

const shouldShowMerchant = (shouldShowSmartScanFields || isTypeSend) && !isDistanceRequest && !isPerDiemRequest;

Expand Down
25 changes: 24 additions & 1 deletion src/components/MoneyRequestConfirmationListFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {ValueOf} from 'type-fest';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
import usePrevious from '@hooks/usePrevious';
import useThemeStyles from '@hooks/useThemeStyles';
import {convertToDisplayString} from '@libs/CurrencyUtils';
Expand Down Expand Up @@ -267,6 +268,7 @@ function MoneyRequestConfirmationListFooter({
const [outstandingReportsByPolicyID] = useOnyx(ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID, {
canBeMissing: true,
});
const {policyForMovingExpensesID, shouldSelectPolicy} = usePolicyForMovingExpenses();

const [currentUserLogin] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector, canBeMissing: true});

Expand Down Expand Up @@ -367,6 +369,8 @@ function MoneyRequestConfirmationListFooter({
const resolvedThumbnail = isLocalFile ? receiptThumbnail : tryResolveUrlFromApiRoot(receiptThumbnail ?? '');
const resolvedReceiptImage = isLocalFile ? receiptImage : tryResolveUrlFromApiRoot(receiptImage ?? '');

const shouldNavigateToUpgradePath = !policyForMovingExpensesID && !shouldSelectPolicy;

const contextMenuContextValue = useMemo(
() => ({
anchor: null,
Expand Down Expand Up @@ -558,7 +562,26 @@ function MoneyRequestConfirmationListFooter({
return;
}

Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRoute(), reportActionID));
if (shouldNavigateToUpgradePath) {
Navigation.navigate(
ROUTES.MONEY_REQUEST_UPGRADE.getRoute({
action,
iouType,
transactionID,
reportID,
backTo: ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRoute(), reportActionID),
upgradePath: CONST.UPGRADE_PATHS.CATEGORIES,
}),
);
} else if (!policy && shouldSelectPolicy) {
Navigation.navigate(
ROUTES.SET_DEFAULT_WORKSPACE.getRoute(
ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRoute(), reportActionID),
),
);
} else {
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, iouType, transactionID, reportID, Navigation.getActiveRoute(), reportActionID));
}
}}
style={[styles.moneyRequestMenuItem]}
titleStyle={styles.flex1}
Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@
// transactionCategory can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const shouldShowCategory =
(isPolicyExpenseChat && (categoryForDisplay || hasEnabledOptions(policyCategories ?? {}))) || (isExpenseUnreported && (!policyForMovingExpenses || policy?.areCategoriesEnabled));
(isPolicyExpenseChat && (categoryForDisplay || hasEnabledOptions(policyCategories ?? {}))) ||
(isExpenseUnreported && (!policyForMovingExpenses || hasEnabledOptions(policyCategories ?? {})));
// transactionTag can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const shouldShowTag = isPolicyExpenseChat && (transactionTag || hasEnabledTags(policyTagLists));
Expand Down Expand Up @@ -548,7 +549,7 @@

const getAttendeesTitle = useMemo(() => {
return Array.isArray(actualAttendees) ? actualAttendees.map((item) => item?.displayName ?? item?.login).join(', ') : '';
}, [transactionAttendees]);

Check warning on line 552 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useMemo has a missing dependency: 'actualAttendees'. Either include it or remove the dependency array

Check warning on line 552 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has a missing dependency: 'actualAttendees'. Either include it or remove the dependency array
const attendeesCopyValue = !canEdit ? getAttendeesTitle : undefined;

const previousTagLength = getLengthOfTag(previousTag ?? '');
Expand Down
3 changes: 1 addition & 2 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,7 @@ type NewReportWorkspaceSelectionNavigatorParamList = {

type SetDefaultWorkspaceNavigatorParamList = {
[SCREENS.SET_DEFAULT_WORKSPACE.ROOT]: {
// eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md
backTo?: Routes;
navigateTo?: Routes;
};
};

Expand Down
18 changes: 16 additions & 2 deletions src/pages/SetDefaultWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import type {WorkspaceListItem} from '@hooks/useWorkspaceList';
import useWorkspaceList from '@hooks/useWorkspaceList';
import Log from '@libs/Log';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SetDefaultWorkspaceNavigatorParamList} from '@libs/Navigation/types';
import {hasEnabledOptions} from '@libs/OptionsListUtils';
import {isPaidGroupPolicy} from '@libs/PolicyUtils';
import {setNameValuePair} from '@userActions/User';
import ONYXKEYS from '@src/ONYXKEYS';
Expand All @@ -23,13 +25,14 @@ import type SCREENS from '@src/SCREENS';
type SetDefaultWorkspacePageProps = PlatformStackScreenProps<SetDefaultWorkspaceNavigatorParamList, typeof SCREENS.SET_DEFAULT_WORKSPACE.ROOT>;

function SetDefaultWorkspacePage({route}: SetDefaultWorkspacePageProps) {
const {backTo} = route.params ?? {};
const {navigateTo} = route.params ?? {};
const {isOffline} = useNetwork();
const styles = useThemeStyles();
const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState('');
const {translate, localeCompare} = useLocalize();

const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: false});
const [allPolicyCategories] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES, {canBeMissing: false});
const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: false});
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: false});

Expand All @@ -40,9 +43,20 @@ function SetDefaultWorkspacePage({route}: SetDefaultWorkspacePageProps) {
if (!selectedPolicyID) {
return;
}
if (!navigateTo) {
Log.hmmm(`[SetDefaultWorkspacePage] navigateTo is undefined. Cannot navigate after setting default workspace to ${selectedPolicyID}`);
return;
}
const policyCategories = allPolicyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${selectedPolicyID}`];

// eslint-disable-next-line rulesdir/no-default-id-values
setNameValuePair(ONYXKEYS.NVP_ACTIVE_POLICY_ID, selectedPolicyID, activePolicyID ?? '');
Navigation.goBack(backTo);
if (hasEnabledOptions(policyCategories ?? {})) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please add an explanation comment here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's readable enough - if we don't have any categories we go back, otherwise we choose categories

Navigation.navigate(navigateTo);
return;
}

Navigation.goBack();
};

const {sections, shouldShowNoResultsFoundMessage, shouldShowSearchInput} = useWorkspaceList({
Expand Down
5 changes: 3 additions & 2 deletions src/pages/iou/request/step/IOURequestStepCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ function IOURequestStepCategory({

const isUnreportedExpense = isExpenseUnreported(transaction);
const {policyForMovingExpenses, policyForMovingExpensesID} = usePolicyForMovingExpenses();
const isCreatingTrackExpense = action === CONST.IOU.ACTION.CREATE && iouType === CONST.IOU.TYPE.TRACK;

const policyIdReal = getIOURequestPolicyID(transaction, reportReal);
const policyIdDraft = getIOURequestPolicyID(transaction, reportDraft);
const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyIdReal}`, {canBeMissing: true});
const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyIdDraft}`, {canBeMissing: true});
const policy = isUnreportedExpense ? policyForMovingExpenses : (policyReal ?? policyDraft);
const policyID = isUnreportedExpense ? policyForMovingExpensesID : policy?.id;
const policy = isUnreportedExpense || isCreatingTrackExpense ? policyForMovingExpenses : (policyReal ?? policyDraft);
const policyID = isUnreportedExpense || isCreatingTrackExpense ? policyForMovingExpensesID : policy?.id;

const [splitDraftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`, {canBeMissing: true});
const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, {canBeMissing: true});
Expand Down
41 changes: 26 additions & 15 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import useOnboardingTaskInformation from '@hooks/useOnboardingTaskInformation';
import useOnyx from '@hooks/useOnyx';
import useParticipantsInvoiceReport from '@hooks/useParticipantsInvoiceReport';
import usePermissions from '@hooks/usePermissions';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {completeTestDriveTask} from '@libs/actions/Task';
Expand Down Expand Up @@ -146,24 +147,17 @@ function IOURequestStepConfirmation({
category,
})),
);

const realPolicyID = getIOURequestPolicyID(initialTransaction, reportReal);
const isUnreported = transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
const isCreatingTrackExpense = action === CONST.IOU.ACTION.CREATE && iouType === CONST.IOU.TYPE.TRACK;
const {policyForMovingExpenses, policyForMovingExpensesID} = usePolicyForMovingExpenses();
const realPolicyID = isCreatingTrackExpense || isUnreported ? policyForMovingExpensesID : getIOURequestPolicyID(initialTransaction, reportReal);
const draftPolicyID = getIOURequestPolicyID(initialTransaction, reportDraft);
const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${draftPolicyID}`, {canBeMissing: true});
const [policyReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${realPolicyID}`, {canBeMissing: true});
const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${realPolicyID}`, {canBeMissing: true});
const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${draftPolicyID}`, {canBeMissing: true});
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${realPolicyID}`, {canBeMissing: true});
const [userLocation] = useOnyx(ONYXKEYS.USER_LOCATION, {canBeMissing: true});
const [reportAttributesDerived] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {canBeMissing: true, selector: reportsSelector});
const [recentlyUsedDestinations] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_DESTINATIONS}${realPolicyID}`, {canBeMissing: true});
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${realPolicyID}`, {canBeMissing: true});

/*
* We want to use a report from the transaction if it exists
* Also if the report was submitted and delayed submission is on, then we should use an initial report
*/
const isUnreported = transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
const transactionReport = getReportOrDraftReport(transaction?.reportID);
const shouldUseTransactionReport =
transactionReport && !(isProcessingReport(transactionReport) && !policyReal?.harvesting?.enabled) && isReportOutstanding(transactionReport, policyReal?.id, undefined, false);
Expand All @@ -176,9 +170,20 @@ function IOURequestStepConfirmation({
}
return reportReal ?? reportDraft;
}, [isUnreported, shouldUseTransactionReport, transactionReport, reportReal, reportDraft]);
const policy = policyReal ?? policyDraft;
const policyID = isUnreported ? policy?.id : getIOURequestPolicyID(transaction, report);

const policy = isCreatingTrackExpense || isUnreported ? policyForMovingExpenses : (policyReal ?? policyDraft);
const policyID = isCreatingTrackExpense || isUnreported ? policyForMovingExpensesID : getIOURequestPolicyID(transaction, report);
const isDraftPolicy = policy === policyDraft;

const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${realPolicyID}`, {canBeMissing: true});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it make sense to use the policyID here?
same for other data below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@parasharrajat I also changed the realPolicyID to be policyForMovingExpensesID isCreatingTrackExpense || isUnreported ? policyForMovingExpensesID. Take a look at the changes. Before them we also had policyID and realPolicyID. Why? I'm not sure and I guess it would take at least half a day to understand that. 😅

For now I just want to make it work not breaking anything and causing regressions 😄 When we have the feature complete and working I would love to work on some cleanup.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

also for getting all the data we used realPolicyID, so let's leave this way (at least for now)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sounds good.

const [policyCategoriesDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES_DRAFT}${draftPolicyID}`, {canBeMissing: true});
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${realPolicyID}`, {canBeMissing: true});
const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${realPolicyID}`, {canBeMissing: true});

const [userLocation] = useOnyx(ONYXKEYS.USER_LOCATION, {canBeMissing: true});
const [reportAttributesDerived] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {canBeMissing: true, selector: reportsSelector});
const [recentlyUsedDestinations] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_DESTINATIONS}${realPolicyID}`, {canBeMissing: true});

const policyCategories = policyCategoriesReal ?? policyCategoriesDraft;
const receiverParticipant: Participant | InvoiceReceiver | undefined = transaction?.participants?.find((participant) => participant?.accountID) ?? report?.invoiceReceiver;
const receiverAccountID = receiverParticipant && 'accountID' in receiverParticipant && receiverParticipant.accountID ? receiverParticipant.accountID : CONST.DEFAULT_NUMBER_ID;
Expand Down Expand Up @@ -259,6 +264,10 @@ function IOURequestStepConfirmation({
}, []);

useEffect(() => {
if (isCreatingTrackExpense && policyForMovingExpensesID !== undefined && policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
openDraftWorkspaceRequest(policyForMovingExpensesID);
}

const policyExpenseChat = participants?.find((participant) => participant.isPolicyExpenseChat);
if (policyExpenseChat?.policyID && policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
openDraftWorkspaceRequest(policyExpenseChat.policyID);
Expand All @@ -267,7 +276,7 @@ function IOURequestStepConfirmation({
if (senderPolicyParticipant?.policyID && policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
openDraftWorkspaceRequest(senderPolicyParticipant.policyID);
}
}, [isOffline, participants, policy?.pendingAction]);
}, [isCreatingTrackExpense, isOffline, participants, policy?.pendingAction, policyForMovingExpensesID]);

const defaultBillable = !!policy?.defaultBillable;
useEffect(() => {
Expand Down Expand Up @@ -317,7 +326,9 @@ function IOURequestStepConfirmation({
if (!item.category) {
return;
}
if (policyCategories?.[item.category] && !policyCategories[item.category].enabled) {

// Clear category field when the category doesn't exist for selected policy, or it's disabled
if (!policyCategories?.[item.category] || !policyCategories[item.category]?.enabled) {
setMoneyRequestCategory(item.transactionID, '', policy?.id);
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/pages/iou/request/step/IOURequestStepUpgrade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type IOURequestStepUpgradeProps = PlatformStackScreenProps<MoneyRequestNavigator

function IOURequestStepUpgrade({
route: {
params: {transactionID, action, reportID, shouldSubmitExpense, upgradePath},
params: {transactionID, action, reportID, shouldSubmitExpense, upgradePath, backTo},
},
}: IOURequestStepUpgradeProps) {
const styles = useThemeStyles();
Expand Down Expand Up @@ -90,11 +90,11 @@ function IOURequestStepUpgrade({
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_REPORT.getRoute(action, CONST.IOU.TYPE.SUBMIT, transactionID, reportID));
break;
case CONST.UPGRADE_PATHS.CATEGORIES:
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, CONST.IOU.TYPE.SUBMIT, transactionID, reportID));
Navigation.navigate(backTo ?? ROUTES.MONEY_REQUEST_STEP_CATEGORY.getRoute(action, CONST.IOU.TYPE.SUBMIT, transactionID, reportID));
break;
default:
}
}, [action, reportID, shouldSubmitExpense, transactionID, upgradePath]);
}, [action, backTo, reportID, shouldSubmitExpense, transactionID, upgradePath]);

const adminParticipant = useMemo(() => {
const participant = transaction?.participants?.[0];
Expand Down
Loading