提交 87823368 编写于 作者: S Sandeep Somavarapu

Watermark: Adopt to new configuration update event. Check if key has changed.

上级 7f89b243
...@@ -100,6 +100,7 @@ const folderEntries = [ ...@@ -100,6 +100,7 @@ const folderEntries = [
]; ];
const UNBOUND = nls.localize('watermark.unboundCommand', "unbound"); const UNBOUND = nls.localize('watermark.unboundCommand', "unbound");
const WORKBENCH_TIPS_ENABLED_KEY = 'workbench.tips.enabled';
export class WatermarkContribution implements IWorkbenchContribution { export class WatermarkContribution implements IWorkbenchContribution {
...@@ -120,19 +121,21 @@ export class WatermarkContribution implements IWorkbenchContribution { ...@@ -120,19 +121,21 @@ export class WatermarkContribution implements IWorkbenchContribution {
lifecycleService.onShutdown(this.dispose, this); lifecycleService.onShutdown(this.dispose, this);
this.partService.joinCreation().then(() => { this.partService.joinCreation().then(() => {
this.enabled = this.configurationService.getValue<boolean>('workbench.tips.enabled'); this.enabled = this.configurationService.getValue<boolean>(WORKBENCH_TIPS_ENABLED_KEY);
if (this.enabled) { if (this.enabled) {
this.create(); this.create();
} }
}); });
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => { this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => {
const enabled = this.configurationService.getValue<boolean>('workbench.tips.enabled'); if (e.hasKeyChanged(WORKBENCH_TIPS_ENABLED_KEY)) {
if (enabled !== this.enabled) { const enabled = this.configurationService.getValue<boolean>(WORKBENCH_TIPS_ENABLED_KEY);
this.enabled = enabled; if (enabled !== this.enabled) {
if (this.enabled) { this.enabled = enabled;
this.create(); if (this.enabled) {
} else { this.create();
this.destroy(); } else {
this.destroy();
}
} }
} }
})); }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册