Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ef190b3
Fix Your spend totals staying stale after offline expense edits.
adamgrzybowski Jun 8, 2026
fabd3fd
Remove redundant YourSpendSection queries barrel
adamgrzybowski Jun 9, 2026
3545edc
Remove unused exports from YourSpendSnapshotUpdate
adamgrzybowski Jun 9, 2026
d767640
Fix ESLint no-unsafe-type-assertion errors in Your spend snapshot test
adamgrzybowski Jun 11, 2026
215db73
Patch Your spend totals only for amount edits, not currency changes
adamgrzybowski Jun 11, 2026
009264f
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jun 11, 2026
6831b5f
Add Your spend report-move snapshot helper and tests
adamgrzybowski Jun 12, 2026
a377443
Patch Your spend totals on retract, unapprove and submit
adamgrzybowski Jun 12, 2026
33aabfd
Patch Your spend totals on delete, reject and cancel payment
adamgrzybowski Jun 12, 2026
421fed6
Fix Your spend offline patches for multi-currency reports
adamgrzybowski Jun 12, 2026
5a2979e
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jun 12, 2026
a7d3e35
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jun 17, 2026
fa6b8ba
Patch Your spend totals on approve
adamgrzybowski Jun 17, 2026
c3d8ad1
Patch Your spend totals on report-level reject
adamgrzybowski Jun 17, 2026
6035a7a
Patch Your spend snapshot count alongside total
adamgrzybowski Jun 17, 2026
75daafd
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jun 18, 2026
2bf9c54
Fix Your spend offline patch using convertedAmount in wrong currency
adamgrzybowski Jun 18, 2026
52e56dd
Fix Your spend section not appearing when submitting first report off…
adamgrzybowski Jun 19, 2026
a5d9074
Patch Your spend "Awaiting approval" total when splitting a submitted…
adamgrzybowski Jun 19, 2026
4e6f872
Fix Your spend offline total sign and empty Search page after submit
adamgrzybowski Jun 25, 2026
72448a2
Fix Your Spend section disappearing after deleting a split expense of…
adamgrzybowski Jun 25, 2026
f6d66d3
Fix offline Your Spend repaid section after paying reports
adamgrzybowski Jun 25, 2026
f7fbe84
Add SNAPSHOT key to PayMoneyRequest onyxData return type
adamgrzybowski Jun 26, 2026
d6dac62
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jun 29, 2026
f69d9ff
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jul 3, 2026
3a835dd
Trim verbose comments in Your spend snapshot updates
adamgrzybowski Jul 3, 2026
2946111
Sync Your spend snapshot data on transaction removal and bound memory
adamgrzybowski Jul 3, 2026
274a485
Fix Your spend for reimbursable-only split and reimbursable toggle
adamgrzybowski Jul 7, 2026
61f248f
Test Your spend snapshot updates for reimbursable toggle
adamgrzybowski Jul 7, 2026
7a36b36
Supply Your spend patch data via hook scoped to paid-group policies
adamgrzybowski Jul 9, 2026
3622a9b
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jul 9, 2026
eea3c27
Remove unused SnapshotSearch export from YourSpendPatchData
adamgrzybowski Jul 9, 2026
6f1a6ec
Reset Mobile-Expensify submodule pointer to match eorigin/main
adamgrzybowski Jul 15, 2026
e316cc3
Merge remote-tracking branch 'eorigin/main' into @adamgrzybowski/fix-…
adamgrzybowski Jul 15, 2026
cf97be9
Merge branch 'main' into @adamgrzybowski/fix-offline-your-spend
adamgrzybowski Jul 15, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotal
import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {generateDefaultWorkspaceName} from '@libs/actions/Policy/Policy';
import {search} from '@libs/actions/Search';
Expand Down Expand Up @@ -167,6 +168,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
const {currentSearchQueryJSON, currentSearchKey} = useSearchQueryContext();
const {currentSearchResults} = useSearchResultsContext();
const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.hash, true);
const yourSpendPatchData = useYourSpendPatchData();

const isInvoiceReport = isInvoiceReportUtil(moneyRequestReport);
const isAnyTransactionOnHold = hasHeldExpensesReportUtils(allTransactions);
Expand Down Expand Up @@ -238,6 +240,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
amountOwed,
ownerBillingGracePeriodEnd,
methodID: type === CONST.IOU.PAYMENT_TYPE.VBBA ? methodID : undefined,
yourSpendPatchData,
onPaid: () => {
startAnimation();
},
Expand Down Expand Up @@ -450,6 +453,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo
ownerBillingGracePeriodEnd,
delegateEmail,
isTrackIntentUser,
yourSpendPatchData,
ownerLogin: submitterLogin,
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import usePayChatReportActions from '@hooks/usePayChatReportActions';
import usePolicy from '@hooks/usePolicy';
import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotals';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {generateDefaultWorkspaceName} from '@libs/actions/Policy/Policy';
import {search} from '@libs/actions/Search';
Expand Down Expand Up @@ -120,6 +121,7 @@ function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) {
const {currentSearchQueryJSON, currentSearchKey} = useSearchQueryContext();
const {currentSearchResults} = useSearchResultsContext();
const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.hash, true);
const yourSpendPatchData = useYourSpendPatchData();

const {openHoldMenu} = useMoneyReportHeaderModals();

Expand Down Expand Up @@ -179,6 +181,7 @@ function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) {
amountOwed,
ownerBillingGracePeriodEnd,
methodID: type === CONST.IOU.PAYMENT_TYPE.VBBA ? methodID : undefined,
yourSpendPatchData,
onPaid: startAnimation,
chatReportActions: getChatReportActions(false),
isTrackIntentUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import usePermissions from '@hooks/usePermissions';
import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotals';
import useStrictPolicyRules from '@hooks/useStrictPolicyRules';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {search} from '@libs/actions/Search';
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
Expand Down Expand Up @@ -111,6 +112,7 @@ function SubmitPrimaryActionContent({reportID}: SubmitPrimaryActionProps) {
const {currentSearchQueryJSON, currentSearchKey} = useSearchQueryContext();
const {currentSearchResults} = useSearchResultsContext();
const shouldCalculateTotals = useSearchShouldCalculateTotals(currentSearchKey, currentSearchQueryJSON?.hash, true);
const yourSpendPatchData = useYourSpendPatchData();

const handleSubmit = () => {
if (!moneyRequestReport || shouldBlockSubmit) {
Expand Down Expand Up @@ -138,6 +140,7 @@ function SubmitPrimaryActionContent({reportID}: SubmitPrimaryActionProps) {
expenseReportCurrentNextStepDeprecated: nextStep,
userBillingGracePeriodEnds,
amountOwed,
yourSpendPatchData,
onSubmitted: startSubmittingAnimation,
ownerBillingGracePeriodEnd,
delegateEmail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import {isSubmitPolicy} from '@libs/PolicyUtils';
Expand Down Expand Up @@ -38,6 +39,7 @@ function useConfirmApproval(reportID: string | undefined, startApprovedAnimation
const [ownerLogin] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetailsLoginSelector(moneyRequestReport?.ownerAccountID)});
const {transactions: reportTransactions} = useTransactionsAndViolationsForReport(moneyRequestReport?.reportID);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const yourSpendPatchData = useYourSpendPatchData();

const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const hasViolations = hasViolationsReportUtils(moneyRequestReport?.reportID, allTransactionViolations, accountID, email ?? '');
Expand Down Expand Up @@ -69,6 +71,7 @@ function useConfirmApproval(reportID: string | undefined, startApprovedAnimation
ownerBillingGracePeriodEnd,
ownerLogin,
full: true,
yourSpendPatchData,
onApproved: startApprovedAnimation,
delegateEmail,
isTrackIntentUser,
Expand Down
3 changes: 3 additions & 0 deletions src/components/MoneyRequestHeaderSecondaryActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useThrottledButtonState from '@hooks/useThrottledButtonState';
import useTransactionViolations from '@hooks/useTransactionViolations';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {duplicateExpenseTransaction as duplicateTransactionAction} from '@libs/actions/IOU/Duplicate';
import {deleteTrackExpense} from '@libs/actions/IOU/TrackExpense';
Expand Down Expand Up @@ -114,6 +115,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
const {login: currentUserLogin, accountID, localCurrencyCode} = useCurrentUserPersonalDetails();
const delegateAccountID = useDelegateAccountID();
const personalDetails = usePersonalDetails();
const yourSpendPatchData = useYourSpendPatchData();

const expensifyIcons = useMemoizedLazyExpensifyIcons([
'ArrowCollapse',
Expand Down Expand Up @@ -489,6 +491,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
currentUserAccountID: accountID,
currentUserEmail: currentUserLogin ?? '',
policy: iouPolicy,
yourSpendPatchData,
});
} else {
if (shouldOpenSplitExpenseEditFlowOnDelete([transaction.transactionID])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import useReportTransactionViolations from '@hooks/useReportTransactionViolations';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {hasHeldExpensesFromTransactions as hasHeldExpensesReportUtils, hasViolations as hasViolationsReportUtils} from '@libs/ReportUtils';

Expand Down Expand Up @@ -47,6 +48,8 @@ function ApproveActionButton() {
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});

const {transactions: reportTransactions} = useTransactionsAndViolationsForReport(iouReport?.reportID);
const yourSpendPatchData = useYourSpendPatchData();

const allTransactionValues = Object.values(reportTransactions);
const transactions = allTransactionValues;

Expand Down Expand Up @@ -75,6 +78,7 @@ function ApproveActionButton() {
ownerBillingGracePeriodEnd,
ownerLogin,
full: true,
yourSpendPatchData,
onApproved: startApprovedAnimation,
delegateEmail,
isTrackIntentUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import usePermissions from '@hooks/usePermissions';
import usePolicy from '@hooks/usePolicy';
import useReportTransactionsCollection from '@hooks/useReportTransactionsCollection';
import useReportTransactionViolations from '@hooks/useReportTransactionViolations';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {generateDefaultWorkspaceName} from '@libs/actions/Policy/Policy';
import {getTotalAmountForIOUReportPreviewButton} from '@libs/MoneyRequestReportUtils';
Expand Down Expand Up @@ -75,6 +76,7 @@ function PayActionButton() {
const [delegateEmail] = useOnyx(ONYXKEYS.ACCOUNT, {selector: delegateEmailSelector});
const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector});

const yourSpendPatchData = useYourSpendPatchData();
const reportTransactionsCollection = useReportTransactionsCollection(iouReportID);
const transactions = Object.values(reportTransactionsCollection ?? {}).filter(
(t): t is Transaction => !!t && (isOffline || t.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE),
Expand Down Expand Up @@ -114,6 +116,7 @@ function PayActionButton() {
ownerBillingGracePeriodEnd,
ownerLogin,
full: true,
yourSpendPatchData,
onApproved: startApprovedAnimation,
delegateEmail,
isTrackIntentUser,
Expand Down Expand Up @@ -171,6 +174,7 @@ function PayActionButton() {
amountOwed,
ownerBillingGracePeriodEnd,
methodID: type === CONST.IOU.PAYMENT_TYPE.VBBA ? methodID : undefined,
yourSpendPatchData,
onPaid: startAnimation,
chatReportActions: getChatReportActions(false),
isTrackIntentUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import useReportTransactionsCollection from '@hooks/useReportTransactionsCollection';
import useReportTransactionViolations from '@hooks/useReportTransactionViolations';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {hasDynamicExternalWorkflow, isSubmitPolicy} from '@libs/PolicyUtils';
import {hasViolations as hasViolationsReportUtils, shouldShowMarkAsDone} from '@libs/ReportUtils';
Expand Down Expand Up @@ -72,6 +73,7 @@ function SubmitActionButtonContent() {
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});
const [delegateEmail] = useOnyx(ONYXKEYS.ACCOUNT, {selector: delegateEmailSelector});
const {isOffline} = useNetwork();
const yourSpendPatchData = useYourSpendPatchData();
const reportTransactionsCollection = useReportTransactionsCollection(iouReportID);
const transactions = Object.values(reportTransactionsCollection ?? {}).filter(
(t): t is Transaction => !!t && (isOffline || t.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE),
Expand Down Expand Up @@ -120,6 +122,7 @@ function SubmitActionButtonContent() {
expenseReportCurrentNextStepDeprecated: iouReportNextStep,
userBillingGracePeriodEnds,
amountOwed,
yourSpendPatchData,
onSubmitted: startSubmittingAnimation,
ownerBillingGracePeriodEnd,
delegateEmail,
Expand Down
3 changes: 3 additions & 0 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import useTransactionViolations from '@hooks/useTransactionViolations';
import type {ViolationField} from '@hooks/useViolations';
import useViolations from '@hooks/useViolations';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {updateMoneyRequestBillable, updateMoneyRequestCategory, updateMoneyRequestReimbursable, updateMoneyRequestTag, updateMoneyRequestTaxRate} from '@libs/actions/IOU/UpdateMoneyRequest';
import {openExternalLink} from '@libs/actions/Link';
Expand Down Expand Up @@ -221,7 +222,7 @@
let [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`);
parentReport = parentReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`];
const [parentReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${getNonEmptyStringOnyxID(parentReport?.reportID)}`);
const [reportPolicyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(parentReport?.policyID)}`);

Check failure on line 225 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Cannot redeclare block-scoped variable 'reportPolicyTags'.

const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`);
const parentReportAction = transactionThreadReport?.parentReportActionID ? parentReportActions?.[transactionThreadReport.parentReportActionID] : undefined;
Expand Down Expand Up @@ -280,6 +281,7 @@
const personalDetailsList = usePersonalDetails();
const currentUserAccountIDParam = currentUserPersonalDetails.accountID;
const currentUserEmailParam = currentUserPersonalDetails.login ?? '';
const yourSpendPatchData = useYourSpendPatchData();
const {isBetaEnabled} = usePermissions();
const isASAPSubmitBetaEnabled = isBetaEnabled(CONST.BETAS.ASAP_SUBMIT);
const isP2PDistanceRequest = isCustomUnitRateIDForP2P(transaction);
Expand Down Expand Up @@ -699,6 +701,7 @@
isOffline,
delegateAccountID,
isTrackIntentUser,
yourSpendPatchData,
});
};

Expand Down Expand Up @@ -878,7 +881,7 @@
});
};

const [reportPolicyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(parentReport?.policyID)}`);

Check failure on line 884 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / typecheck

Cannot redeclare block-scoped variable 'reportPolicyTags'.

Check failure on line 884 in src/components/ReportActionItem/MoneyRequestView.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

'reportPolicyTags' is already defined

const showTagDisabledAlert = (tagListIndex: number) => {
const transactionID = transaction?.transactionID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {useReportPaymentContext} from '@hooks/usePaymentContext';
import usePolicy from '@hooks/usePolicy';
import useReportWithTransactionsAndViolations from '@hooks/useReportWithTransactionsAndViolations';
import useThemeStyles from '@hooks/useThemeStyles';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {payInvoice, payMoneyRequest} from '@libs/actions/IOU/PayMoneyRequest';
import {canIOUBePaid} from '@libs/actions/IOU/ReportWorkflow';
Expand Down Expand Up @@ -45,6 +46,7 @@ function PayActionCell({isLoading, policyID, reportID, hash, amount, shouldDisab
const {isDelegateAccessRestricted} = useDelegateNoAccessState();
const {showDelegateNoAccessModal} = useDelegateNoAccessActions();
const [iouReport, transactions] = useReportWithTransactionsAndViolations(reportID);
const yourSpendPatchData = useYourSpendPatchData();
const policy = usePolicy(policyID);
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);
const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
Expand Down Expand Up @@ -151,6 +153,7 @@ function PayActionCell({isLoading, policyID, reportID, hash, amount, shouldDisab
ownerBillingGracePeriodEnd,
methodID: type === CONST.IOU.PAYMENT_TYPE.VBBA ? methodID : undefined,
additionalOnyxData,
yourSpendPatchData,
chatReportActions: allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${getNonEmptyStringOnyxID(chatReport?.reportID)}`],
isTrackIntentUser,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {handleActionButtonPress} from '@libs/actions/Search';
import {syncMissingAttendeesViolation} from '@libs/AttendeeUtils';
Expand Down Expand Up @@ -218,6 +219,7 @@ function ExpenseReportListItemInner<TItem extends ListItem>({
const openReportSubmitToPopover = useOpenReportSubmitToPopover();
const {shouldDisableSearchSubmitPress, consumeIgnoreNextSearchSubmitPress} = useSearchSubmitPopoverGuard();
const {transactions: reportTransactions, violations: reportViolations} = useTransactionsAndViolationsForReport(reportItem.reportID);
const yourSpendPatchData = useYourSpendPatchData();
const liveReportTransactions = useMemo(() => Object.values(reportTransactions), [reportTransactions]);

// Recompute the violations badge from live data at the row, replacing the screen-level
Expand Down Expand Up @@ -297,6 +299,7 @@ function ExpenseReportListItemInner<TItem extends ListItem>({
chatReportActions,
delegateEmail,
isTrackIntentUser,
yourSpendPatchData,
});
}, [
currentSearchHash,
Expand Down Expand Up @@ -336,6 +339,7 @@ function ExpenseReportListItemInner<TItem extends ListItem>({
chatReportActions,
delegateEmail,
isTrackIntentUser,
yourSpendPatchData,
]);

const handleSelectionButtonPress = useCallback(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
import type {ModifiedMouseEvent} from '@libs/Navigation/helpers/openInternalRouteInNewTab';
Expand Down Expand Up @@ -295,6 +296,7 @@ function ReportListItemHeaderInner<TItem extends ListItem>({

const openReportSubmitToPopover = useOpenReportSubmitToPopover();
const {shouldDisableSearchSubmitPress, consumeIgnoreNextSearchSubmitPress} = useSearchSubmitPopoverGuard();
const yourSpendPatchData = useYourSpendPatchData();

const handleOnButtonPress = (event?: ModifiedMouseEvent) => {
handleActionButtonPress({
Expand Down Expand Up @@ -330,6 +332,7 @@ function ReportListItemHeaderInner<TItem extends ListItem>({
chatReportActions,
delegateEmail,
isTrackIntentUser,
yourSpendPatchData,
});
};
return !isLargeScreenWidth ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import useOnyx from '@hooks/useOnyx';
import {useReportPaymentContext} from '@hooks/usePaymentContext';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import type {TransactionPreviewData} from '@libs/actions/Search';
import {handleActionButtonPress as handleActionButtonPressUtil} from '@libs/actions/Search';
Expand Down Expand Up @@ -197,6 +198,7 @@ function TransactionListItemInner<TItem extends ListItem>({
const {showConfirmModal} = useConfirmModal();
const openReportSubmitToPopover = useOpenReportSubmitToPopover();
const {shouldDisableSearchSubmitPress, consumeIgnoreNextSearchSubmitPress} = useSearchSubmitPopoverGuard();
const yourSpendPatchData = useYourSpendPatchData();

const handleActionButtonPress = (event?: Parameters<typeof onSelectRow>[2]) => {
handleActionButtonPressUtil({
Expand Down Expand Up @@ -233,6 +235,7 @@ function TransactionListItemInner<TItem extends ListItem>({
chatReportActions,
delegateEmail,
isTrackIntentUser,
yourSpendPatchData,
});
};

Expand Down
3 changes: 3 additions & 0 deletions src/components/SettlementButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import usePolicy from '@hooks/usePolicy';
import useThemeStyles from '@hooks/useThemeStyles';
import useYourSpendPatchData from '@hooks/useYourSpendPatchData';

import {createWorkspace, generateDefaultWorkspaceName, isCurrencySupportedForDirectReimbursement, isCurrencySupportedForGlobalReimbursement} from '@libs/actions/Policy/Policy';
import {navigateToBankAccountRoute} from '@libs/actions/ReimbursementAccount';
Expand Down Expand Up @@ -120,6 +121,7 @@ function SettlementButton({
const expenseReportPolicy = usePolicy(iouReport?.policyID);
const {accountID, email = ''} = useCurrentUserPersonalDetails();
const lastWorkspaceNumber = useLastWorkspaceNumber();
const yourSpendPatchData = useYourSpendPatchData();

// The app would crash due to subscribing to the entire report collection if chatReportID is an empty string. So we should have a fallback ID here.
// eslint-disable-next-line rulesdir/no-default-id-values
Expand Down Expand Up @@ -529,6 +531,7 @@ function SettlementButton({
ownerBillingGracePeriodEnd,
ownerLogin,
full: false,
yourSpendPatchData,
delegateEmail,
isTrackIntentUser,
});
Expand Down
Loading
Loading