From 7ec5eea227ee9cb7c61beafeed11f1e624165b5f Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Sun, 12 Jan 2025 08:15:38 +0530 Subject: [PATCH] fix ESLint issues. Signed-off-by: krishna2323 --- src/components/ReportActionItem/MoneyRequestAction.tsx | 7 +++++-- src/pages/home/report/ReportActionItemContentCreated.tsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestAction.tsx b/src/components/ReportActionItem/MoneyRequestAction.tsx index 8b8ddecf96e2..2bd197daa3c6 100644 --- a/src/components/ReportActionItem/MoneyRequestAction.tsx +++ b/src/components/ReportActionItem/MoneyRequestAction.tsx @@ -88,12 +88,15 @@ function MoneyRequestAction({ const onMoneyRequestPreviewPressed = () => { if (isSplitBillAction) { - const reportActionID = action.reportActionID ?? '-1'; + const reportActionID = action.reportActionID; Navigation.navigate(ROUTES.SPLIT_BILL_DETAILS.getRoute(chatReportID, reportActionID, Navigation.getReportRHPActiveRoute())); return; } - const childReportID = action?.childReportID ?? '-1'; + const childReportID = action?.childReportID; + if (!childReportID) { + return; + } Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(childReportID)); }; diff --git a/src/pages/home/report/ReportActionItemContentCreated.tsx b/src/pages/home/report/ReportActionItemContentCreated.tsx index 3ecb6bfbda8c..109ccd04353a 100644 --- a/src/pages/home/report/ReportActionItemContentCreated.tsx +++ b/src/pages/home/report/ReportActionItemContentCreated.tsx @@ -52,8 +52,8 @@ function ReportActionItemContentCreated({contextValue, parentReportAction, trans const {translate} = useLocalize(); const {report, action, transactionThreadReport} = contextValue; - const policy = usePolicy(report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? '-1' : report.policyID ?? '-1'); - const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID ?? '-1'}`); + const policy = usePolicy(report.policyID === CONST.POLICY.OWNER_EMAIL_FAKE ? undefined : report.policyID); + const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID ?? CONST.DEFAULT_NUMBER_ID}`); const transactionCurrency = TransactionUtils.getCurrency(transaction);