From b6faa559d8064b7d6302b971bf9ff7113d1bbeed Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 27 Aug 2024 22:35:52 +0800 Subject: [PATCH 1/3] fallback using double pipe --- src/pages/home/report/ReportActionItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 11fe5b01ad67..508782372590 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -178,7 +178,7 @@ function ReportActionItem({ const {translate} = useLocalize(); const {shouldUseNarrowLayout} = useResponsiveLayout(); const blockedFromConcierge = useBlockedFromConcierge(); - const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(report.reportID, action) ?? '-1', [report.reportID, action]); + const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(report.reportID, action) || '-1', [report.reportID, action]); const [draftMessage] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${originalReportID}`, { selector: (draftMessagesForReport) => { const matchingDraftMessage = draftMessagesForReport?.[action.reportActionID]; From ddbe832a84136be27043cd518d4af5fc2dfe4021 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 27 Aug 2024 22:50:08 +0800 Subject: [PATCH 2/3] supress lint --- src/pages/home/report/ReportActionItem.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 508782372590..81eea8866181 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -178,6 +178,7 @@ function ReportActionItem({ const {translate} = useLocalize(); const {shouldUseNarrowLayout} = useResponsiveLayout(); const blockedFromConcierge = useBlockedFromConcierge(); + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const originalReportID = useMemo(() => ReportUtils.getOriginalReportID(report.reportID, action) || '-1', [report.reportID, action]); const [draftMessage] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${originalReportID}`, { selector: (draftMessagesForReport) => { From c7d65ab202c5979ad43064b36bc4eee51d06d78c Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 27 Aug 2024 23:20:46 +0800 Subject: [PATCH 3/3] use double pipe --- src/libs/actions/ReportActions.ts | 3 ++- .../home/report/ContextMenu/PopoverReportActionContextMenu.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/ReportActions.ts b/src/libs/actions/ReportActions.ts index b3718079441f..ed8d4886659c 100644 --- a/src/libs/actions/ReportActions.ts +++ b/src/libs/actions/ReportActions.ts @@ -32,7 +32,8 @@ function clearReportActionErrors(reportID: string, reportAction: ReportAction, k }); // If there's a linked transaction, delete that too - const linkedTransactionID = ReportActionUtils.getLinkedTransactionID(reportAction.reportActionID, originalReportID ?? '-1'); + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + const linkedTransactionID = ReportActionUtils.getLinkedTransactionID(reportAction.reportActionID, originalReportID || '-1'); if (linkedTransactionID) { Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION}${linkedTransactionID}`, null); } diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx index 5cfce625201e..6593c967c8e8 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx @@ -211,7 +211,8 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef