提交 e62f2e3e 编写于 作者: M Matt Bierner

Only require a reviver being registered to revive a webview

Fixes #80184

Don't rely on a state being set as well
上级 a62b7dab
......@@ -96,7 +96,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
// This should trigger the real reviver to be registered from the extension host side.
this._register(_webviewEditorService.registerResolver({
canResolve: (webview: WebviewInput) => {
if (!webview.webview.state && webview.getTypeId() === WebviewInput.typeId) { // TODO: The typeid check is a workaround for the CustomFileEditorInput case
if (webview.getTypeId() !== WebviewInput.typeId) { // TODO: The typeid check is a workaround for the CustomFileEditorInput case
return false;
}
......@@ -198,7 +198,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
this._revivers.set(viewType, this._webviewEditorService.registerResolver({
canResolve: (webviewEditorInput) => {
return !!webviewEditorInput.webview.state && webviewEditorInput.viewType === this.getInternalWebviewViewType(viewType);
return webviewEditorInput.viewType === this.getInternalWebviewViewType(viewType);
},
resolveWebview: async (webviewEditorInput): Promise<void> => {
const viewType = this.fromInternalWebviewViewType(webviewEditorInput.viewType);
......
......@@ -232,11 +232,6 @@ export class WebviewEditorService implements IWebviewEditorService {
public shouldPersist(
webview: WebviewInput
): boolean {
// Has no state, don't persist
if (!webview.webview.state) {
return false;
}
if (values(this._revivers).some(reviver => canRevive(reviver, webview))) {
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册