Skip to content

Commit 9f7551b

Browse files
committed
fix: Not here page when selecting waypoints second time onwards via Add expense CTA flow
1 parent 4692a45 commit 9f7551b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/MoneyRequestReportView/MoneyRequestReportTransactionList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
1919
import useHandleSelectionMode from '@hooks/useHandleSelectionMode';
2020
import useLocalize from '@hooks/useLocalize';
2121
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
22+
import useOnyx from '@hooks/useOnyx';
2223
import useReportIsArchived from '@hooks/useReportIsArchived';
2324
import useResponsiveLayout from '@hooks/useResponsiveLayout';
2425
import useStyleUtils from '@hooks/useStyleUtils';
@@ -175,7 +176,11 @@ function MoneyRequestReportTransactionList({
175176
const currentUserDetails = useCurrentUserPersonalDetails();
176177
const isReportArchived = useReportIsArchived(report?.reportID);
177178
const shouldShowAddExpenseButton = canAddTransaction(report, isReportArchived) && isCurrentUserSubmitter(report);
178-
const addExpenseDropdownOptions = useMemo(() => getAddExpenseDropdownOptions(report?.reportID, policy), [report?.reportID, policy]);
179+
const [lastDistanceExpenseType] = useOnyx(ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE, {canBeMissing: true});
180+
const addExpenseDropdownOptions = useMemo(
181+
() => getAddExpenseDropdownOptions(report?.reportID, policy, undefined, undefined, lastDistanceExpenseType),
182+
[report?.reportID, policy, lastDistanceExpenseType],
183+
);
179184

180185
const hasPendingAction = useMemo(() => {
181186
return hasPendingDeletionTransaction || transactions.some(getTransactionPendingAction);

0 commit comments

Comments
 (0)