From 88f9419dacb076cb2eba3342b137756fc599eed2 Mon Sep 17 00:00:00 2001 From: Puneet Lath Date: Tue, 16 Jul 2024 19:20:33 -0500 Subject: [PATCH] Use or syntax instead of nullish coalescing --- src/libs/ReportUtils.ts | 2 +- src/pages/ReportDetailsPage.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 779c2a8d2602..ace8f547b75c 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4681,7 +4681,7 @@ function buildOptimisticGroupChatReport( undefined, undefined, notificationPreference, - '-1', + undefined, undefined, undefined, avatarUri, diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index b48d24d6d67d..284004bc29ca 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -84,11 +84,12 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const styles = useThemeStyles(); // The app would crash due to subscribing to the entire report collection if parentReportID is an empty string. So we should have a fallback ID here. - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID || '-1'}`); - const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID ?? -1}`); - const [parentReportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.parentReportID ?? -1}`); + const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID || '-1'}`); + const [parentReportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.parentReportID || '-1'}`); const {reportActions} = usePaginatedReportActions(report.reportID || '-1'); + /* eslint-enable @typescript-eslint/prefer-nullish-coalescing */ const transactionThreadReportID = useMemo( () => ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, reportActions ?? [], isOffline),