Fix image preview after image update

Fixes #227447
pull/227468/head
Matt Bierner 2024-09-03 12:50:29 -07:00
parent 1bed263b2c
commit 77e9532099
1 changed files with 4 additions and 2 deletions

View File

@ -113,8 +113,6 @@ class ImagePreview extends MediaPreview {
this.updateBinarySize();
this.render();
this.updateState();
this.webviewEditor.webview.postMessage({ type: 'setActive', value: this.webviewEditor.active });
}
public override dispose(): void {
@ -157,6 +155,10 @@ class ImagePreview extends MediaPreview {
this.zoomStatusBarEntry.hide(this);
}
}
protected override async render(): Promise<void> {
await super.render();
this.webviewEditor.webview.postMessage({ type: 'setActive', value: this.webviewEditor.active });
}
protected override async getWebviewContents(): Promise<string> {
const version = Date.now().toString();