mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
web - best lifecycle support we can do currently
This commit is contained in:
@@ -75,7 +75,8 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
|
||||
}));
|
||||
|
||||
this._register(lifecycleService.onBeforeShutdown(e => {
|
||||
e.veto(this._onBeforeShutdown());
|
||||
this._onBeforeShutdown();
|
||||
e.veto(false); // Don't veto shutdown
|
||||
}, this));
|
||||
}
|
||||
|
||||
@@ -217,13 +218,12 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
|
||||
return `mainThreadWebview-${viewType}`;
|
||||
}
|
||||
|
||||
private _onBeforeShutdown(): boolean {
|
||||
private _onBeforeShutdown(): void {
|
||||
this._webviews.forEach((webview) => {
|
||||
if (!webview.isDisposed() && webview.state && this._revivers.has(webview.state.viewType)) {
|
||||
webview.state.state = webview.webviewState;
|
||||
}
|
||||
});
|
||||
return false; // Don't veto shutdown
|
||||
}
|
||||
|
||||
private createWebviewEventDelegate(handle: WebviewPanelHandle) {
|
||||
|
||||
Reference in New Issue
Block a user