diff --git a/src/webviews/apps/shared/appBase.ts b/src/webviews/apps/shared/appBase.ts index ecd3759..06eb5fc 100644 --- a/src/webviews/apps/shared/appBase.ts +++ b/src/webviews/apps/shared/appBase.ts @@ -22,7 +22,7 @@ function nextIpcId() { return `webview:${ipcSequence}`; } -export abstract class App { +export abstract class App { private readonly _api: VsCodeApi; protected state: State; @@ -78,6 +78,8 @@ export abstract class App { protected setState(state: State) { this.state = state; + if (state == null) return; + this._api.setState(state); } diff --git a/src/webviews/apps/shared/events.ts b/src/webviews/apps/shared/events.ts index 2ff81f1..fb24c36 100644 --- a/src/webviews/apps/shared/events.ts +++ b/src/webviews/apps/shared/events.ts @@ -39,6 +39,7 @@ export class Emitter { } }, }; + if (Array.isArray(disposables)) { disposables.push(result); } diff --git a/src/webviews/apps/tsconfig.json b/src/webviews/apps/tsconfig.json index 4fae851..ae8ee49 100644 --- a/src/webviews/apps/tsconfig.json +++ b/src/webviews/apps/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "allowSyntheticDefaultImports": true, "lib": ["dom", "dom.iterable", "es2020"], "outDir": "../../" },