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:
DeviSriSaiCharan
2026-06-22 23:27:03 +05:30
committed by GitHub
parent 222ac80f5e
commit 5f55a5924d

View File

@@ -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)}`);
};