Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
zirgulis committed Nov 26, 2024
1 parent c61583b commit 7a27b43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6230,9 +6230,11 @@ function getSendMoneyParams(
},
);

if (optimisticChatReportActionsData.value) {
const optimisticChatReportActionsValue = optimisticChatReportActionsData.value as Record<string, OnyxTypes.ReportAction>;

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({
Expand Down
6 changes: 4 additions & 2 deletions tests/actions/ReportTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, OnyxTypes.ReportAction>;

if (optimisticReportActionsValue?.[400]) {
optimisticReportActionsValue[400].created = reportActionCreatedDate;
}

// When we emit the events for these pending created actions to update them to not pending
Expand Down

0 comments on commit 7a27b43

Please sign in to comment.