From a98bbee68d54f9af773f325c9a4301e357afff90 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 23 Jul 2024 15:58:27 +0700 Subject: [PATCH 1/2] fix app crashes when submiting track-expense to someone --- src/pages/home/report/ReportActionItemContentCreated.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index 776ea8aeea02..73f04772f03d 100644 --- a/src/pages/home/report/ReportActionItemContentCreated.tsx +++ b/src/pages/home/report/ReportActionItemContentCreated.tsx @@ -17,6 +17,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; +import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import type * as OnyxTypes from '@src/types/onyx'; @@ -51,7 +52,7 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans const {report, action, transactionThreadReport} = contextValue; - const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID ?? '-1'}`); + const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? -1 : report.policyID ?? '-1'}`); const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID ?? '-1'}`); const transactionCurrency = TransactionUtils.getCurrency(transaction); From a680ecc261cc8f6846172f2c93e75ff7f2e26d2b Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 23 Jul 2024 21:58:58 +0700 Subject: [PATCH 2/2] fallback to string --- src/pages/home/report/ReportActionItemContentCreated.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index 73f04772f03d..7d1f27920bdf 100644 --- a/src/pages/home/report/ReportActionItemContentCreated.tsx +++ b/src/pages/home/report/ReportActionItemContentCreated.tsx @@ -52,7 +52,7 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans const {report, action, transactionThreadReport} = contextValue; - const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? -1 : report.policyID ?? '-1'}`); + const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? '-1' : report.policyID ?? '-1'}`); const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID ?? '-1'}`); const transactionCurrency = TransactionUtils.getCurrency(transaction);