Skip to content

Commit

Permalink
Fix image preview after image update
Browse files Browse the repository at this point in the history
Fixes #227447
  • Loading branch information
mjbvz committed Sep 3, 2024
1 parent 1bed263 commit 77e9532
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/media-preview/src/imagePreview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 77e9532

Please sign in to comment.