提交 35bf784b 编写于 作者: C Christof Marti

Always show watermark, first session experiment (#15547)

上级 2a4cd323
......@@ -23,7 +23,7 @@ export interface ITelemetryInfo {
export interface ITelemetryExperiments {
showDefaultViewlet: boolean;
showCommandsWatermark: boolean;
showFirstSessionWatermark: boolean;
openUntitledFile: boolean;
}
......@@ -46,7 +46,7 @@ export interface ITelemetryService {
export const defaultExperiments: ITelemetryExperiments = {
showDefaultViewlet: false,
showCommandsWatermark: false,
showFirstSessionWatermark: false,
openUntitledFile: true
};
......@@ -80,7 +80,7 @@ export function loadExperiments(storageService: IStorageService, configurationSe
const random0 = parseFloat(valueString);
let [random1, showDefaultViewlet] = splitRandom(random0);
const [random2, showCommandsWatermark] = splitRandom(random1);
const [random2, showFirstSessionWatermark] = splitRandom(random1);
let [, openUntitledFile] = splitRandom(random2);
// is the user a first time user?
......@@ -93,7 +93,7 @@ export function loadExperiments(storageService: IStorageService, configurationSe
return applyOverrides(configurationService, {
showDefaultViewlet,
showCommandsWatermark,
showFirstSessionWatermark,
openUntitledFile
});
}
......
......@@ -138,14 +138,12 @@ export class WatermarkContribution implements IWorkbenchContribution {
@IKeybindingService private keybindingService: IKeybindingService,
@IWorkspaceContextService private contextService: IWorkspaceContextService,
@IStorageService private storageService: IStorageService,
@ITelemetryService telemetryService: ITelemetryService
@ITelemetryService private telemetryService: ITelemetryService
) {
if (telemetryService.getExperiments().showCommandsWatermark) {
lifecycleService.onShutdown(this.dispose, this);
this.partService.joinCreation().then(() => {
this.create();
});
}
lifecycleService.onShutdown(this.dispose, this);
this.partService.joinCreation().then(() => {
this.create();
});
}
public getId() {
......@@ -160,7 +158,8 @@ export class WatermarkContribution implements IWorkbenchContribution {
const box = $(watermark)
.div({ 'class': 'watermark-box' });
const folder = !!this.contextService.getWorkspace();
const firstSession = !this.storageService.get('telemetry.lastSessionDate');
const firstSession = this.telemetryService.getExperiments().showFirstSessionWatermark &&
!this.storageService.get('telemetry.lastSessionDate');
const selected = (folder ? folderEntries : firstSession ? firstSessionEntries : noFolderEntries)
.filter(entry => !('mac' in entry) || entry.mac === isMacintosh);
const update = () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册