Skip to content

Commit 963eb94

Browse files
committed
Report-Report is not shown in WS chat online after trying to move it to deleted WS offline
1 parent 649eff9 commit 963eb94

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/libs/actions/Report.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5427,7 +5427,7 @@ function changeReportPolicy(reportID: string, policyID: string) {
54275427
if (reportToMove?.parentReportID && reportToMove?.parentReportActionID) {
54285428
const workspaceChatReportID = reportToMove.parentReportID;
54295429
const reportPreviewActionID = reportToMove.parentReportActionID;
5430-
const oldReportPreviewAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChatReportID}`]?.[reportPreviewActionID];
5430+
const oldReportPreviewAction = allReportActions?.[workspaceChatReportID]?.[reportPreviewActionID];
54315431
const deletedTime = DateUtils.getDBTime();
54325432
const firstMessage = Array.isArray(oldReportPreviewAction?.message) ? oldReportPreviewAction.message.at(0) : null;
54335433
const updatedReportPreviewAction = {
@@ -5459,7 +5459,14 @@ function changeReportPolicy(reportID: string, policyID: string) {
54595459
failureData.push({
54605460
onyxMethod: Onyx.METHOD.MERGE,
54615461
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${workspaceChatReportID}`,
5462-
value: {[reportPreviewActionID]: oldReportPreviewAction},
5462+
value: {
5463+
[reportPreviewActionID]: {
5464+
...oldReportPreviewAction,
5465+
originalMessage: {
5466+
deleted: null,
5467+
},
5468+
},
5469+
},
54635470
});
54645471

54655472
// Update the expense chat report

0 commit comments

Comments
 (0)