Skip to content

Commit c4fad83

Browse files
authored
Add overrideCategory back (microsoft#180975)
1 parent 738ab79 commit c4fad83

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,13 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ
377377
this.metadata.set(categoryID, { firstSeen: +new Date(), stepIDs: walkthrough.steps?.map(s => s.id) ?? [], manaullyOpened: false });
378378
}
379379

380+
const override = await Promise.race([
381+
this.tasExperimentService?.getTreatment<string>(`gettingStarted.overrideCategory.${extension.identifier.value + '.' + walkthrough.id}.when`),
382+
new Promise<string | undefined>(resolve => setTimeout(() => resolve(walkthrough.when), 5000))
383+
]);
384+
380385
if (this.sessionInstalledExtensions.has(extension.identifier.value.toLowerCase())
381-
&& this.contextService.contextMatchesRules(ContextKeyExpr.deserialize(walkthrough.when) ?? ContextKeyExpr.true())
386+
&& this.contextService.contextMatchesRules(ContextKeyExpr.deserialize(override ?? walkthrough.when) ?? ContextKeyExpr.true())
382387
) {
383388
this.sessionInstalledExtensions.delete(extension.identifier.value.toLowerCase());
384389
if (index < sectionToOpenIndex && isNewlyInstalled) {
@@ -460,7 +465,7 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ
460465
? FileAccess.uriToBrowserUri(joinPath(extension.extensionLocation, iconStr)).toString(true)
461466
: DefaultIconPath
462467
},
463-
when: ContextKeyExpr.deserialize(walkthrough.when) ?? ContextKeyExpr.true(),
468+
when: ContextKeyExpr.deserialize(override ?? walkthrough.when) ?? ContextKeyExpr.true(),
464469
} as const;
465470

466471
this._registerWalkthrough(walkthoughDescriptor);

0 commit comments

Comments
 (0)