From 7a27b430b4439c7cfc101f3df41a730e8a5e3f77 Mon Sep 17 00:00:00 2001 From: Povilas Zirgulis Date: Tue, 26 Nov 2024 19:46:19 +0200 Subject: [PATCH] fix types --- src/libs/actions/IOU.ts | 6 ++++-- tests/actions/ReportTest.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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