diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 6d37eeaf084b..035d3c13d137 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2742,6 +2742,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); }