mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-01 16:44:16 +00:00
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
This commit is contained in:
@@ -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)}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user