Skip to content

Commit

Permalink
Merge pull request #33053 from software-mansion-labs/fix/Report-leave…
Browse files Browse the repository at this point in the history
…-room

Fix for - Unable to leave public room
  • Loading branch information
Julesssss authored Dec 14, 2023
2 parents 5c0f3e4 + 592c1b2 commit a64e3cd
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2054,29 +2054,22 @@ function leaveRoom(reportID: string, isWorkspaceMemberLeavingWorkspaceRoom = fal
// 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".
const optimisticData: OnyxUpdate[] = [
isWorkspaceMemberLeavingWorkspaceRoom
? {
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: isWorkspaceMemberLeavingWorkspaceRoom
? {
notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
},
}
: {
onyxMethod: Onyx.METHOD.SET,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
reportID,
}
: {
reportID: null,
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
statusNum: CONST.REPORT.STATUS.CLOSED,
chatType: report.chatType,
parentReportID: report.parentReportID,
parentReportActionID: report.parentReportActionID,
policyID: report.policyID,
type: report.type,
notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN,
},
},
},
];

const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
Expand Down

0 comments on commit a64e3cd

Please sign in to comment.