Fix retained webview incorrectly refreshing on resume

Fix #44681
This commit is contained in:
Matt Bierner
2018-02-28 00:08:06 -08:00
parent a48c4d702f
commit 103d106421

View File

@@ -138,6 +138,10 @@ class WebviewInput extends EditorInput {
}
public setHtml(value: string): void {
if (value === this._html) {
return;
}
this._html = value;
if (this._webview) {
@@ -213,6 +217,8 @@ class WebviewInput extends EditorInput {
this._webviewOwner = undefined;
this.container.style.visibility = 'hidden';
this._html = '';
}
public onDidChangePosition(position: Position) {
@@ -362,7 +368,7 @@ class WebviewEditor extends BaseWebviewEditor {
useSameOriginForRoot: false,
localResourceRoots: (input && input.options.localResourceRoots) || this._contextService.getWorkspace().folders.map(x => x.uri)
};
webview.contents = input.html;
input.setHtml(input.html);
this.webviewContent.style.visibility = 'visible';
this.doUpdateContainer();
}