From 5f55a5924da59b87b4784bff2f10b1715a5e6820 Mon Sep 17 00:00:00 2001 From: DeviSriSaiCharan <143397375+DeviSriSaiCharan@users.noreply.github.com> Date: Mon, 22 Jun 2026 23:27:03 +0530 Subject: [PATCH] fix: prevent redundant workspace switch toast (#8229) * fix: prevent redundant workspace switch toast - Added an early return check in the switchWorkspace Redux action. - Prevents unnecessary state hydration and toast notifications when a user clicks on the already active workspace. * fix: return boolean status from switchWorkspace action to handle success and error states correctly * revert: changes made for the switchWorkspace to check if user switchedto the already active workspace * refactor: prevent unnecessary workspace switches and success notification logic * Remove async from handleWorkspaceSwitch function --- packages/bruno-app/src/components/AppTitleBar/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/bruno-app/src/components/AppTitleBar/index.js b/packages/bruno-app/src/components/AppTitleBar/index.js index 2e2dff474..226ce2189 100644 --- a/packages/bruno-app/src/components/AppTitleBar/index.js +++ b/packages/bruno-app/src/components/AppTitleBar/index.js @@ -146,6 +146,8 @@ const AppTitleBar = () => { }; const handleWorkspaceSwitch = (workspaceUid) => { + if (workspaceUid === activeWorkspaceUid) return; + dispatch(switchWorkspace(workspaceUid)); toast.success(`Switched to ${getWorkspaceDisplayName(workspaces.find((w) => w.uid === workspaceUid)?.name)}`); };