Skip to content

Commit 94a6034

Browse files
authored
Merge pull request Expensify#61044 from software-mansion-labs/jnowakow/fix-61004
[CP Staging] Default parentChatID to undefiend
2 parents 072532e + 06ca5c2 commit 94a6034

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/libs/ReportUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6525,7 +6525,7 @@ function buildOptimisticChatReport({
65256525
writeCapability,
65266526
notificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS,
65276527
parentReportActionID = '',
6528-
parentReportID = '',
6528+
parentReportID = undefined,
65296529
description = '',
65306530
avatarUrl = '',
65316531
optimisticReportID = '',

src/pages/ReportDetailsPage.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
170170
const styles = useThemeStyles();
171171
const backTo = route.params.backTo;
172172

173-
// 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.
174-
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
175173
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`, {canBeMissing: true});
176174

177175
const [reportPDFFilename] = useOnyx(`${ONYXKEYS.COLLECTION.NVP_EXPENSIFY_REPORT_PDFFILENAME}${report?.reportID}`, {canBeMissing: true}) ?? null;
@@ -182,9 +180,10 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta
182180
selector: (actions) => (report?.parentReportActionID ? actions?.[report.parentReportActionID] : undefined),
183181
canBeMissing: true,
184182
});
183+
185184
const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID}`, {canBeMissing: false});
186185
const [parentReportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.parentReportID}`, {canBeMissing: true});
187-
/* eslint-enable @typescript-eslint/prefer-nullish-coalescing */
186+
188187
const {reportActions} = usePaginatedReportActions(report.reportID);
189188
const {currentSearchHash} = useSearchContext();
190189

0 commit comments

Comments
 (0)