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

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

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