diff --git a/src/libs/actions/Report/index.ts b/src/libs/actions/Report/index.ts index 53cce02a4bfc..b6f459c7d9cc 100644 --- a/src/libs/actions/Report/index.ts +++ b/src/libs/actions/Report/index.ts @@ -4435,7 +4435,7 @@ function leaveRoom( // If a workspace member is leaving a workspace room, they don't actually lose the room from Onyx. // Instead, their notification preference just gets set to "hidden". // Same applies for chat threads too - const optimisticData: Array> = [ + const optimisticData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, @@ -4459,9 +4459,14 @@ function leaveRoom( }, }, }, + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM}${reportID}`, + value: true, + }, ]; - const successData: Array> = []; + const successData: Array> = []; if (isWorkspaceMemberLeavingWorkspaceRoom || isChatThread) { successData.push({ onyxMethod: Onyx.METHOD.MERGE, @@ -4484,12 +4489,17 @@ function leaveRoom( }); } - const failureData: Array> = [ + const failureData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, value: report, }, + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.REPORT_USER_IS_LEAVING_ROOM}${reportID}`, + value: false, + }, ]; if (report.parentReportID && report.parentReportActionID) {