diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 3fb01f916acd..7e014d37c336 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6230,9 +6230,11 @@ function getSendMoneyParams( }, ); - if (optimisticChatReportActionsData.value) { + const optimisticChatReportActionsValue = optimisticChatReportActionsData.value as Record; + + if (optimisticChatReportActionsValue) { // Add an optimistic created action to the optimistic chat reportActions data - optimisticChatReportActionsData.value[optimisticCreatedActionForChat.reportActionID] = optimisticCreatedActionForChat; + optimisticChatReportActionsValue[optimisticCreatedActionForChat.reportActionID] = optimisticCreatedActionForChat; } } else { failureData.push({ diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 1cd17e33829d..f31370de73dd 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -393,8 +393,10 @@ describe('actions/Report', () => { jest.advanceTimersByTime(10); reportActionCreatedDate = DateUtils.getDBTime(); - if (optimisticReportActions.value?.[400]) { - optimisticReportActions.value[400].created = reportActionCreatedDate; + const optimisticReportActionsValue = optimisticReportActions.value as Record; + + if (optimisticReportActionsValue?.[400]) { + optimisticReportActionsValue[400].created = reportActionCreatedDate; } // When we emit the events for these pending created actions to update them to not pending