From e2364aee29548411e652d3c4e60f316a2dbc8ee1 Mon Sep 17 00:00:00 2001 From: Yuwen Memon Date: Thu, 30 Jan 2025 17:58:12 -0800 Subject: [PATCH] fix: default chat report id --- src/components/SettlementButton/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SettlementButton/index.tsx b/src/components/SettlementButton/index.tsx index 80edd83e305d..667826d29f8b 100644 --- a/src/components/SettlementButton/index.tsx +++ b/src/components/SettlementButton/index.tsx @@ -69,7 +69,7 @@ function SettlementButton({ const {translate} = useLocalize(); const {isOffline} = useNetwork(); // The app would crash due to subscribing to the entire report collection if chatReportID is an empty string. So we should have a fallback ID here. - const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID ?? CONST.DEFAULT_NUMBER_ID}`); + const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID || CONST.DEFAULT_NUMBER_ID}`); const [isUserValidated] = useOnyx(ONYXKEYS.USER, {selector: (user) => !!user?.validated}); const policyEmployeeAccountIDs = policyID ? getPolicyEmployeeAccountIDs(policyID) : []; const reportBelongsToWorkspace = policyID ? doesReportBelongToWorkspace(chatReport, policyEmployeeAccountIDs, policyID) : false;