From 93c621b62d93a4bb75bf9185a52374343f82e443 Mon Sep 17 00:00:00 2001 From: Christoph Fricke Date: Thu, 23 Sep 2021 16:09:31 +0200 Subject: [PATCH] fix(klighd-vscode): sync with editor is not toggled A rename proposed for #13 caused this problem, since "in" checks are not correctly refactored. --- applications/klighd-vscode/src/klighd-extension.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/applications/klighd-vscode/src/klighd-extension.ts b/applications/klighd-vscode/src/klighd-extension.ts index 31c79ba5..819abe96 100644 --- a/applications/klighd-vscode/src/klighd-extension.ts +++ b/applications/klighd-vscode/src/klighd-extension.ts @@ -227,17 +227,15 @@ export class KLighDExtension extends SprottyLspVscodeExtension { this.context.subscriptions.push( commands.registerCommand(command.diagramSync, () => { const activeWebview = this.findActiveWebview(); - if (activeWebview && "toggleEditorSync" in activeWebview) { - (activeWebview as KLighDWebview).setSyncWithEditor(true); - } + + (activeWebview as KLighDWebview)?.setSyncWithEditor?.(true); }) ); this.context.subscriptions.push( commands.registerCommand(command.diagramNoSync, () => { const activeWebview = this.findActiveWebview(); - if (activeWebview && "toggleEditorSync" in activeWebview) { - (activeWebview as KLighDWebview).setSyncWithEditor(false); - } + + (activeWebview as KLighDWebview)?.setSyncWithEditor?.(false); }) ); }