From 4d5fbf798ad6ff05d3613badfbb09c6093c07f80 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 10:39:42 -0600 Subject: [PATCH 01/10] Add parameter for if the report is archived --- src/components/ReportActionItem/ReportPreview.tsx | 4 +++- src/libs/ReportPreviewActionUtils.ts | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index cc5b3e522961..813ca4597c0c 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -23,6 +23,7 @@ import useNetwork from '@hooks/useNetwork'; import useOnyx from '@hooks/useOnyx'; import usePaymentAnimations from '@hooks/usePaymentAnimations'; import usePolicy from '@hooks/usePolicy'; +import useReportIsArchived from '@hooks/useReportIsArchived'; import useReportWithTransactionsAndViolations from '@hooks/useReportWithTransactionsAndViolations'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -152,6 +153,7 @@ function ReportPreview({ const policy = usePolicy(policyID); const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`, {canBeMissing: false}); const [iouReport, transactions, violations] = useReportWithTransactionsAndViolations(iouReportID); + const isIouReportArchived = useReportIsArchived(iouReportID); const lastTransaction = transactions?.at(0); const transactionIDList = transactions?.map((reportTransaction) => reportTransaction.transactionID) ?? []; const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: false}); @@ -508,7 +510,7 @@ function ReportPreview({ }, [iouReportID]); const reportPreviewAction = useMemo(() => { - return getReportPreviewAction(violations, iouReport, policy, transactions); + return getReportPreviewAction(violations, iouReport, policy, transactions, isIouReportArchived); }, [iouReport, policy, violations, transactions]); const reportPreviewActions = { diff --git a/src/libs/ReportPreviewActionUtils.ts b/src/libs/ReportPreviewActionUtils.ts index 5a66e64e96d6..0e4de32f06a5 100644 --- a/src/libs/ReportPreviewActionUtils.ts +++ b/src/libs/ReportPreviewActionUtils.ts @@ -80,11 +80,8 @@ function canApprove(report: Report, violations: OnyxCollection 0; } -function canPay(report: Report, violations: OnyxCollection, policy?: Policy) { - const reportNameValuePairs = getReportNameValuePairs(report.chatReportID); - const isChatReportArchived = isArchivedReport(reportNameValuePairs); - - if (isChatReportArchived) { +function canPay(report: Report, violations: OnyxCollection, policy?: Policy, isReportArchived = false) { + if (isReportArchived) { return false; } @@ -180,6 +177,7 @@ function getReportPreviewAction( report?: Report, policy?: Policy, transactions?: Transaction[], + isReportArchived = false, ): ValueOf { if (!report) { return CONST.REPORT.REPORT_PREVIEW_ACTIONS.VIEW; @@ -190,7 +188,7 @@ function getReportPreviewAction( if (canApprove(report, violations, policy, transactions)) { return CONST.REPORT.REPORT_PREVIEW_ACTIONS.APPROVE; } - if (canPay(report, violations, policy)) { + if (canPay(report, violations, policy, isReportArchived)) { return CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY; } if (canExport(report, violations, policy)) { From aa620df39ff670256c985d1260df5640977b404f Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 10:40:03 -0600 Subject: [PATCH 02/10] Refactor report preview --- src/components/ReportActionItem/ReportPreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 813ca4597c0c..063f0f5d09b5 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -511,7 +511,7 @@ function ReportPreview({ const reportPreviewAction = useMemo(() => { return getReportPreviewAction(violations, iouReport, policy, transactions, isIouReportArchived); - }, [iouReport, policy, violations, transactions]); + }, [iouReport, policy, violations, transactions, isIouReportArchived]); const reportPreviewActions = { [CONST.REPORT.REPORT_PREVIEW_ACTIONS.SUBMIT]: ( From 7f2a2b1351fe88162971f7eb9bba335d403e1412 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 10:41:05 -0600 Subject: [PATCH 03/10] Refactor money request report preview --- .../MoneyRequestReportPreviewContent.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index a83bc51b082b..aced87d2d8b2 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -21,6 +21,7 @@ import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import usePaymentAnimations from '@hooks/usePaymentAnimations'; +import useReportIsArchived from '@hooks/useReportIsArchived'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useStyleUtils from '@hooks/useStyleUtils'; import useTheme from '@hooks/useTheme'; @@ -133,6 +134,7 @@ function MoneyRequestReportPreviewContent({ const [isHoldMenuVisible, setIsHoldMenuVisible] = useState(false); const [requestType, setRequestType] = useState(); const [paymentType, setPaymentType] = useState(); + const isIouReportArchived = useReportIsArchived(iouReportID); const getCanIOUBePaid = useCallback( (shouldShowOnlyPayElsewhere = false, shouldCheckApprovedState = true) => @@ -448,8 +450,8 @@ function MoneyRequestReportPreviewContent({ }, [iouReportID]); const reportPreviewAction = useMemo(() => { - return getReportPreviewAction(violations, iouReport, policy, transactions); - }, [iouReport, policy, violations, transactions]); + return getReportPreviewAction(violations, iouReport, policy, transactions, isIouReportArchived); + }, [iouReport, policy, violations, transactions, isIouReportArchived]); const reportPreviewActions = { [CONST.REPORT.REPORT_PREVIEW_ACTIONS.SUBMIT]: ( From dc267578f132f88df2af2212a770b78ec2465be6 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 11:00:18 -0600 Subject: [PATCH 04/10] Update tests --- tests/actions/ReportPreviewActionUtilsTest.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tests/actions/ReportPreviewActionUtilsTest.ts b/tests/actions/ReportPreviewActionUtilsTest.ts index d2f0ed61bf2e..6a66e8a392ea 100644 --- a/tests/actions/ReportPreviewActionUtilsTest.ts +++ b/tests/actions/ReportPreviewActionUtilsTest.ts @@ -1,5 +1,7 @@ +import {renderHook} from '@testing-library/react-native'; import type {OnyxCollection} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; +import useReportIsArchived from '@hooks/useReportIsArchived'; // eslint-disable-next-line no-restricted-syntax import type * as PolicyUtils from '@libs/PolicyUtils'; import getReportPreviewAction from '@libs/ReportPreviewActionUtils'; @@ -70,7 +72,9 @@ describe('getReportPreviewAction', () => { } await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report); - expect(getReportPreviewAction(VIOLATIONS, report, policy)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.SUBMIT); + // Simulate how components use a hook to pass the isReportArchived parameter + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.SUBMIT); }); it('canApprove should return true for report being processed', async () => { @@ -90,7 +94,8 @@ describe('getReportPreviewAction', () => { await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report); - expect(getReportPreviewAction(VIOLATIONS, report, policy)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.APPROVE); + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.APPROVE); }); it('canPay should return true for expense report with payments enabled', async () => { @@ -109,7 +114,8 @@ describe('getReportPreviewAction', () => { await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report); - expect(getReportPreviewAction(VIOLATIONS, report, policy)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY); + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY); }); it('canPay should return true for submitted invoice', async () => { @@ -128,7 +134,8 @@ describe('getReportPreviewAction', () => { await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report); - expect(getReportPreviewAction(VIOLATIONS, report, policy)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY); + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY); }); it('canExport should return true for finished reports', async () => { @@ -145,7 +152,8 @@ describe('getReportPreviewAction', () => { policy.reimbursementChoice = CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO; await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report); - expect(getReportPreviewAction(VIOLATIONS, report, policy)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.EXPORT_TO_ACCOUNTING); + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.EXPORT_TO_ACCOUNTING); }); it('canReview should return true for reports where there are violations, user is submitter or approver and Workflows are enabled', async () => { @@ -171,6 +179,7 @@ describe('getReportPreviewAction', () => { } as TransactionViolation, ]); - expect(getReportPreviewAction(VIOLATIONS, report, policy)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.REVIEW); + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.REVIEW); }); }); From 9af83c34b4c3eda77e5c04b19de6ae40e60bd044 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 11:01:21 -0600 Subject: [PATCH 05/10] Add a test for archived report --- tests/actions/ReportPreviewActionUtilsTest.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/actions/ReportPreviewActionUtilsTest.ts b/tests/actions/ReportPreviewActionUtilsTest.ts index 6a66e8a392ea..82b756ba34b8 100644 --- a/tests/actions/ReportPreviewActionUtilsTest.ts +++ b/tests/actions/ReportPreviewActionUtilsTest.ts @@ -138,6 +138,31 @@ describe('getReportPreviewAction', () => { expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY); }); + it('canPay should return false for archived invoice', async () => { + const report = { + ...createRandomReport(REPORT_ID), + type: CONST.REPORT.TYPE.INVOICE, + ownerAccountID: CURRENT_USER_ACCOUNT_ID, + statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED, + stateNum: CONST.REPORT.STATE_NUM.SUBMITTED, + }; + + const policy = createRandomPolicy(0); + policy.role = CONST.POLICY.ROLE.ADMIN; + policy.type = CONST.POLICY.TYPE.CORPORATE; + policy.reimbursementChoice = CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO; + + await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report); + + // This is what indicates that a report is archived (see ReportUtils.isArchivedReport()) + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`, { + private_isArchived: new Date().toString(), + }); + + const {result: isReportArchived} = renderHook(() => useReportIsArchived(report?.parentReportID)); + expect(getReportPreviewAction(VIOLATIONS, report, policy, undefined, isReportArchived.current)).toBe(CONST.REPORT.REPORT_PREVIEW_ACTIONS.PAY); + }); + it('canExport should return true for finished reports', async () => { const report = { ...createRandomReport(REPORT_ID), From 595abe5246a3a938b43b6490e6138325b5cf0937 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 11:02:37 -0600 Subject: [PATCH 06/10] Fix a test failure --- tests/actions/ReportPreviewActionUtilsTest.ts | 3 +++ tests/actions/TaskTest.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/actions/ReportPreviewActionUtilsTest.ts b/tests/actions/ReportPreviewActionUtilsTest.ts index 82b756ba34b8..0645c1ca68c7 100644 --- a/tests/actions/ReportPreviewActionUtilsTest.ts +++ b/tests/actions/ReportPreviewActionUtilsTest.ts @@ -31,6 +31,9 @@ const REPORT_ID = 1; const TRANSACTION_ID = 1; const VIOLATIONS: OnyxCollection = {}; +// This keeps the error "@rnmapbox/maps native code not available." from causing the tests to fail +jest.mock('@components/ConfirmedRoute.tsx'); + jest.mock('@libs/ReportUtils', () => ({ ...jest.requireActual('@libs/ReportUtils'), hasViolations: jest.fn().mockReturnValue(false), diff --git a/tests/actions/TaskTest.ts b/tests/actions/TaskTest.ts index b02896ebd849..ac27906c9f8f 100644 --- a/tests/actions/TaskTest.ts +++ b/tests/actions/TaskTest.ts @@ -19,6 +19,7 @@ import type {ReportActionsCollectionDataSet} from '@src/types/onyx/ReportAction' import * as LHNTestUtils from '../utils/LHNTestUtils'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; +// This keeps the error "@rnmapbox/maps native code not available." from causing the tests to fail jest.mock('@components/ConfirmedRoute.tsx'); OnyxUpdateManager(); From 798de5eaba5f93bcf8bd2a0c8a6cf32643deee7c Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 11:02:37 -0600 Subject: [PATCH 07/10] Fix a test failure --- tests/actions/ReportPreviewActionUtilsTest.ts | 3 +++ tests/actions/TaskTest.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/actions/ReportPreviewActionUtilsTest.ts b/tests/actions/ReportPreviewActionUtilsTest.ts index d2f0ed61bf2e..dac6ec25b6b2 100644 --- a/tests/actions/ReportPreviewActionUtilsTest.ts +++ b/tests/actions/ReportPreviewActionUtilsTest.ts @@ -29,6 +29,9 @@ const REPORT_ID = 1; const TRANSACTION_ID = 1; const VIOLATIONS: OnyxCollection = {}; +// This keeps the error "@rnmapbox/maps native code not available." from causing the tests to fail +jest.mock('@components/ConfirmedRoute.tsx'); + jest.mock('@libs/ReportUtils', () => ({ ...jest.requireActual('@libs/ReportUtils'), hasViolations: jest.fn().mockReturnValue(false), diff --git a/tests/actions/TaskTest.ts b/tests/actions/TaskTest.ts index b02896ebd849..ac27906c9f8f 100644 --- a/tests/actions/TaskTest.ts +++ b/tests/actions/TaskTest.ts @@ -19,6 +19,7 @@ import type {ReportActionsCollectionDataSet} from '@src/types/onyx/ReportAction' import * as LHNTestUtils from '../utils/LHNTestUtils'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; +// This keeps the error "@rnmapbox/maps native code not available." from causing the tests to fail jest.mock('@components/ConfirmedRoute.tsx'); OnyxUpdateManager(); From e53de6b7a6141c0a388cb7e2691a9437d1e41fa6 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 29 Apr 2025 11:21:49 -0600 Subject: [PATCH 08/10] Remove unused import --- src/libs/ReportPreviewActionUtils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/ReportPreviewActionUtils.ts b/src/libs/ReportPreviewActionUtils.ts index 0e4de32f06a5..99376b7dc579 100644 --- a/src/libs/ReportPreviewActionUtils.ts +++ b/src/libs/ReportPreviewActionUtils.ts @@ -16,13 +16,11 @@ import { import { getMoneyRequestSpendBreakdown, getParentReport, - getReportNameValuePairs, getReportTransactions, hasMissingSmartscanFields, hasNoticeTypeViolations, hasViolations, hasWarningTypeViolations, - isArchivedReport, isClosedReport, isCurrentUserSubmitter, isExpenseReport, From 70cb285c96eda0f7d6b287aea75d5152723a0250 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Mon, 5 May 2025 08:36:13 -0600 Subject: [PATCH 09/10] Lint --- .../MoneyRequestReportPreviewContent.tsx | 4 ---- src/components/ReportActionItem/ReportPreview.tsx | 2 -- src/libs/ReportPreviewActionUtils.ts | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx index 590d6dc9d7c7..2207a7c656f0 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx @@ -1,7 +1,6 @@ import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {FlatList, View} from 'react-native'; import type {LayoutChangeEvent, ListRenderItemInfo, ViewToken} from 'react-native'; -import {useOnyx} from 'react-native-onyx'; import Animated, {useAnimatedStyle, useSharedValue, withDelay, withSpring, withTiming} from 'react-native-reanimated'; import type {LayoutRectangle} from 'react-native/Libraries/Types/CoreEventTypes'; import Button from '@components/Button'; @@ -64,7 +63,6 @@ import {approveMoneyRequest, canApproveIOU, canIOUBePaid as canIOUBePaidIOUActio import Timing from '@userActions/Timing'; import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; -import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {Transaction} from '@src/types/onyx'; import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage'; @@ -194,8 +192,6 @@ function MoneyRequestReportPreviewContent({ const isWaitingForSubmissionFromCurrentUser = useMemo(() => isWaitingForSubmissionFromCurrentUserReportUtils(chatReport, policy), [chatReport, policy]); const [isNoDelegateAccessMenuVisible, setIsNoDelegateAccessMenuVisible] = useState(false); - const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${iouReportID}`, {canBeMissing: true}); - const confirmPayment = useCallback( (type: PaymentMethodType | undefined, payAsBusiness?: boolean) => { if (!type) { diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index ded561770a12..4a1428153f31 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -260,8 +260,6 @@ function ReportPreview({ const {isDelegateAccessRestricted} = useDelegateUserDetails(); const [isNoDelegateAccessMenuVisible, setIsNoDelegateAccessMenuVisible] = useState(false); - const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${iouReport?.reportID}`, {canBeMissing: true}); - const confirmPayment = useCallback( (type: PaymentMethodType | undefined, payAsBusiness?: boolean, methodID?: number, paymentMethod?: PaymentMethod) => { if (!type) { diff --git a/src/libs/ReportPreviewActionUtils.ts b/src/libs/ReportPreviewActionUtils.ts index 85287c6fa515..9249bd2620eb 100644 --- a/src/libs/ReportPreviewActionUtils.ts +++ b/src/libs/ReportPreviewActionUtils.ts @@ -1,7 +1,7 @@ import type {OnyxCollection} from 'react-native-onyx'; import type {ValueOf} from 'type-fest'; import CONST from '@src/CONST'; -import type {Policy, Report, ReportNameValuePairs, Transaction, TransactionViolation} from '@src/types/onyx'; +import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx'; import {isApprover as isApproverMember} from './actions/Policy/Member'; import {getCurrentUserAccountID} from './actions/Report'; import { From 610b200b334029893f78043b7147703b16d96492 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Wed, 7 May 2025 02:16:41 +0100 Subject: [PATCH 10/10] Fix bad conflict resolution --- src/components/ReportActionItem/ReportPreview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ReportActionItem/ReportPreview.tsx b/src/components/ReportActionItem/ReportPreview.tsx index 8a53f5da032a..4a1428153f31 100644 --- a/src/components/ReportActionItem/ReportPreview.tsx +++ b/src/components/ReportActionItem/ReportPreview.tsx @@ -153,7 +153,6 @@ function ReportPreview({ const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`, {canBeMissing: false}); const [iouReport, transactions, violations] = useReportWithTransactionsAndViolations(iouReportID); const isIouReportArchived = useReportIsArchived(iouReportID); - const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${iouReport?.reportID}`, {canBeMissing: true}); const lastTransaction = transactions?.at(0); const transactionIDList = transactions?.map((reportTransaction) => reportTransaction.transactionID) ?? []; const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: false});