Skip to content

Commit 15ca98b

Browse files
committed
Show telemetry notice on first start (fixes microsoft#46623)
1 parent 6cd5f64 commit 15ca98b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { INotificationService, Severity } from 'vs/platform/notification/common/
1313
import URI from 'vs/base/common/uri';
1414
import { localize } from 'vs/nls';
1515
import { onUnexpectedError } from 'vs/base/common/errors';
16-
import { IWindowService } from 'vs/platform/windows/common/windows';
16+
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows';
1717

1818
export class TelemetryOptOut implements IWorkbenchContribution {
1919

@@ -24,13 +24,17 @@ export class TelemetryOptOut implements IWorkbenchContribution {
2424
@IOpenerService openerService: IOpenerService,
2525
@INotificationService notificationService: INotificationService,
2626
@IWindowService windowService: IWindowService,
27+
@IWindowsService windowsService: IWindowsService,
2728
@ITelemetryService telemetryService: ITelemetryService
2829
) {
2930
if (!product.telemetryOptOutUrl || storageService.get(TelemetryOptOut.TELEMETRY_OPT_OUT_SHOWN)) {
3031
return;
3132
}
32-
windowService.isFocused().then(focused => {
33-
if (!focused) {
33+
Promise.all([
34+
windowService.isFocused(),
35+
windowsService.getWindowCount()
36+
]).then(([focused, count]) => {
37+
if (!focused && count > 1) {
3438
return null;
3539
}
3640
storageService.store(TelemetryOptOut.TELEMETRY_OPT_OUT_SHOWN, true);

0 commit comments

Comments
 (0)