Skip to content

Commit be70099

Browse files
authored
Check for existing walkthroughs open before opening walkthroughs (microsoft#184466)
1 parent 33c576d commit be70099

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,16 @@ registerAction2(class extends Action2 {
6363
if (walkthroughID) {
6464
const selectedCategory = typeof walkthroughID === 'string' ? walkthroughID : walkthroughID.category;
6565
const selectedStep = typeof walkthroughID === 'string' ? undefined : walkthroughID.step;
66+
67+
let openedWalkthroughExists = false;
6668
// Try first to select the walkthrough on an active welcome page with no selected walkthrough
6769
for (const group of editorGroupsService.groups) {
6870
if (group.activeEditor instanceof GettingStartedInput) {
6971
if (!group.activeEditor.selectedCategory) {
7072
(group.activeEditorPane as GettingStartedPage).makeCategoryVisibleWhenAvailable(selectedCategory, selectedStep);
7173
return;
74+
} else {
75+
openedWalkthroughExists = true;
7276
}
7377
}
7478
}
@@ -83,6 +87,8 @@ registerAction2(class extends Action2 {
8387
editor.selectedStep = selectedStep;
8488
group.openEditor(editor, { revealIfOpened: true });
8589
return;
90+
} else {
91+
openedWalkthroughExists = true;
8692
}
8793
}
8894
}
@@ -102,7 +108,7 @@ registerAction2(class extends Action2 {
102108
editor: activeEditor,
103109
replacement: gettingStartedInput
104110
}]);
105-
} else {
111+
} else if (!openedWalkthroughExists) {
106112
// else open respecting toSide
107113
editorService.openEditor(gettingStartedInput, { preserveFocus: toSide ?? false }, toSide ? SIDE_GROUP : undefined);
108114
}

0 commit comments

Comments
 (0)