Skip to content

Commit a73b1de

Browse files
author
Jackson Kearl
committed
product => productService
1 parent 8440cbc commit a73b1de

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ import { ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND } from 'vs
6464
import { MarkdownRenderer } from 'vs/editor/browser/core/markdownRenderer';
6565
import { startEntries } from 'vs/workbench/contrib/welcome/gettingStarted/common/gettingStartedContent';
6666
import { GettingStartedIndexList } from './gettingStartedList';
67-
import product from 'vs/platform/product/common/product';
6867
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
6968
import { KeyCode } from 'vs/base/common/keyCodes';
7069
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
@@ -938,12 +937,11 @@ export class GettingStartedPage extends EditorPane {
938937
}
939938

940939
const someStepsComplete = this.gettingStartedCategories.some(category => category.steps.find(s => s.done));
941-
942-
if (this.editorInput.showTelemetryNotice && product.openToWelcomeMainPage) {
940+
if (this.editorInput.showTelemetryNotice && this.productService.openToWelcomeMainPage) {
943941
const telemetryNotice = $('p.telemetry-notice');
944942
this.buildTelemetryFooter(telemetryNotice);
945943
footer.appendChild(telemetryNotice);
946-
} else if (!product.openToWelcomeMainPage && !someStepsComplete && !this.hasScrolledToFirstCategory) {
944+
} else if (!this.productService.openToWelcomeMainPage && !someStepsComplete && !this.hasScrolledToFirstCategory) {
947945
const firstSessionDateString = this.storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL) || new Date().toUTCString();
948946
const daysSinceFirstSession = ((+new Date()) - (+new Date(firstSessionDateString))) / 1000 / 60 / 60 / 24;
949947
const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index';
@@ -1417,7 +1415,7 @@ export class GettingStartedPage extends EditorPane {
14171415
const stepListComponent = this.detailsScrollbar.getDomNode();
14181416

14191417
const categoryFooter = $('.getting-started-footer');
1420-
if (this.editorInput.showTelemetryNotice && getTelemetryLevel(this.configurationService) !== TelemetryLevel.NONE && product.enableTelemetry) {
1418+
if (this.editorInput.showTelemetryNotice && getTelemetryLevel(this.configurationService) !== TelemetryLevel.NONE && this.productService.enableTelemetry) {
14211419
this.buildTelemetryFooter(categoryFooter);
14221420
}
14231421

@@ -1442,7 +1440,7 @@ export class GettingStartedPage extends EditorPane {
14421440
const optOutButton = `[${optOutCopy}](command:settings.filterByTelemetry)`;
14431441

14441442
const text = localize({ key: 'footer', comment: ['fist substitution is "vs code", second is "privacy statement", third is "opt out".'] },
1445-
"{0} collects usage data. Read our {1} and learn how to {2}.", product.nameShort, privacyStatementButton, optOutButton);
1443+
"{0} collects usage data. Read our {1} and learn how to {2}.", this.productService.nameShort, privacyStatementButton, optOutButton);
14461444

14471445
parent.append(mdRenderer.render({ value: text, isTrusted: true }).element);
14481446
mdRenderer.dispose();

src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/la
2121
import { GettingStartedInput, gettingStartedInputTypeId } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedInput';
2222
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
2323
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
24-
import product from 'vs/platform/product/common/product';
2524
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
2625
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
26+
import { IProductService } from 'vs/platform/product/common/productService';
2727

2828
const configurationKey = 'workbench.startupEditor';
2929
const oldConfigurationKey = 'workbench.welcome.enabled';
@@ -40,6 +40,7 @@ export class WelcomePageContribution implements IWorkbenchContribution {
4040
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
4141
@ILifecycleService private readonly lifecycleService: ILifecycleService,
4242
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
43+
@IProductService private readonly productService: IProductService,
4344
@ICommandService private readonly commandService: ICommandService,
4445
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
4546
@IStorageService private readonly storageService: IStorageService
@@ -51,8 +52,8 @@ export class WelcomePageContribution implements IWorkbenchContribution {
5152

5253
// Always open Welcome page for first-launch, no matter what is open or which startupEditor is set.
5354
if (
54-
product.enableTelemetry
55-
&& product.showTelemetryOptOut
55+
this.productService.enableTelemetry
56+
&& this.productService.showTelemetryOptOut
5657
&& getTelemetryLevel(this.configurationService) !== TelemetryLevel.NONE
5758
&& !this.environmentService.skipWelcome
5859
&& !this.storageService.get(telemetryOptOutStorageKey, StorageScope.GLOBAL)

0 commit comments

Comments
 (0)