diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 026ce45146d3..af7d1304603a 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2704,6 +2704,12 @@ function leaveRoom(reportID: string, isWorkspaceMemberLeavingWorkspaceRoom = fal }; API.write(WRITE_COMMANDS.LEAVE_ROOM, parameters, {optimisticData, successData, failureData}); + + // If this is the leave action from a workspace room or chat thread, simply dismiss the modal, i.e., allow the user to view the room/thread and join again immediately. + if (isWorkspaceMemberLeavingWorkspaceRoom || isChatThread) { + return; + } + // In other cases, the report is deleted and we should move the user to another report. navigateToMostRecentReport(report); }