fix(workspace): don't auto-open repo when switching to Management view
When switching workspaces, skip calling openRepo if the current activeView is "management". Previously a session.activePath would be opened even when the user was on the Management/dashboard view, causing an unwanted navigate-away. Now a keepDashboard flag prevents openRepo from running in that case, preserving the dashboard state.
This commit is contained in:
+2
-1
@@ -1697,6 +1697,7 @@
|
||||
|
||||
async function switchWorkspace(id: string) {
|
||||
if (isBusy || id === workspaceState.selectedId) return;
|
||||
const keepDashboard = activeView === "management";
|
||||
persistWorkspaces();
|
||||
repoOpenRequestId += 1;
|
||||
closeRepoTabContextMenu();
|
||||
@@ -1706,7 +1707,7 @@
|
||||
repoTabs = session.openPaths.map(path => repoRowFromPath(path));
|
||||
activeView = "management";
|
||||
persistRepoLists();
|
||||
if (session.activePath) await openRepo(session.activePath);
|
||||
if (!keepDashboard && session.activePath) await openRepo(session.activePath);
|
||||
}
|
||||
|
||||
async function saveWorkspace(id: string, name: string, repositories: string[]) {
|
||||
|
||||
Reference in New Issue
Block a user