Skip to content

Commit 0c5a528

Browse files
authored
Move focus check to just before showing walkthrough (microsoft#223573)
1 parent dde43f9 commit 0c5a528

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,12 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ
226226
installed.forEach(ext => this.progressByEvent(`extensionInstalled:${ext.identifier.id.toLowerCase()}`));
227227
});
228228

229-
this._register(this.extensionManagementService.onDidInstallExtensions(async (result) => {
230-
const hadLastFoucs = await this.hostService.hadLastFocus();
229+
this._register(this.extensionManagementService.onDidInstallExtensions((result) => {
231230
for (const e of result) {
232231
const skipWalkthrough = e?.context?.[EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT] || e?.context?.[EXTENSION_INSTALL_DEP_PACK_CONTEXT];
233232
// If the window had last focus and the install didn't specify to skip the walkthrough
234233
// Then add it to the sessionInstallExtensions to be opened
235-
if (hadLastFoucs && !skipWalkthrough) {
234+
if (!skipWalkthrough) {
236235
this.sessionInstalledExtensions.add(e.identifier.id.toLowerCase());
237236
}
238237
this.progressByEvent(`extensionInstalled:${e.identifier.id.toLowerCase()}`);
@@ -408,7 +407,8 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ
408407

409408
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]), StorageScope.PROFILE, StorageTarget.USER);
410409

411-
if (sectionToOpen && this.configurationService.getValue<string>('workbench.welcomePage.walkthroughs.openOnInstall')) {
410+
const hadLastFoucs = await this.hostService.hadLastFocus();
411+
if (hadLastFoucs && sectionToOpen && this.configurationService.getValue<string>('workbench.welcomePage.walkthroughs.openOnInstall')) {
412412
type GettingStartedAutoOpenClassification = {
413413
owner: 'lramos15';
414414
comment: 'When a walkthrthrough is opened upon extension installation';

0 commit comments

Comments
 (0)