Skip to content

Commit 2ed400c

Browse files
committed
webview: Add destroy method.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 7062143 commit 2ed400c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/renderer/js/components/server-tab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class ServerTab extends Tab {
4444

4545
override async destroy(): Promise<void> {
4646
await super.destroy();
47-
(await this.webview).$el.remove();
47+
(await this.webview).destroy();
4848
}
4949

5050
templateHtml(): Html {

app/renderer/js/components/webview.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ export default class WebView {
116116
this.registerListeners();
117117
}
118118

119+
destroy(): void {
120+
this.$el.remove();
121+
}
122+
119123
getWebContents(): WebContents {
120124
return remote.webContents.fromId(this.webContentsId);
121125
}

0 commit comments

Comments
 (0)