From ad4ddd80340f3ed88c173a34042dfe19c64190f6 Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Fri, 8 Mar 2024 16:48:17 +0100 Subject: [PATCH 1/2] fix: crash when offline --- src/pages/home/report/ReportActionItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index a37138b43039..1000a45604b3 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -885,11 +885,11 @@ export default withOnyx({ initialValue: {} as OnyxTypes.Report, }, policyReportFields: { - key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_REPORT_FIELDS}${report.policyID ?? ''}`, + key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_REPORT_FIELDS}${report.policyID ?? 0}`, initialValue: {}, }, policy: { - key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID ?? ''}`, + key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID ?? 0}`, initialValue: {} as OnyxTypes.Policy, }, emojiReactions: { From 45b8ddde909bb81976cb8841236f1df226c7c34d Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Fri, 8 Mar 2024 17:00:07 +0100 Subject: [PATCH 2/2] fix: covered one more case --- 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 1000a45604b3..7285f550d3ca 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -880,7 +880,7 @@ export default withOnyx({ iouReport: { key: ({action}) => { const iouReportID = ReportActionsUtils.getIOUReportIDFromReportActionPreview(action); - return `${ONYXKEYS.COLLECTION.REPORT}${iouReportID ?? ''}`; + return `${ONYXKEYS.COLLECTION.REPORT}${iouReportID ?? 0}`; }, initialValue: {} as OnyxTypes.Report, },