Skip to content

Commit 8f91d7f

Browse files
committed
prevent multiple versions of cr open
1 parent 3a15481 commit 8f91d7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/editor/ReactWebView.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ class ReactWebView {
8181
})
8282
// If we already have a panel, show it.
8383
// Otherwise, create a new panel.
84+
8485
if (this.panel && this.panel.webview) {
85-
this.panel.reveal(vscode.ViewColumn.Two)
86+
if (!this.loaded) {
87+
this.panel.reveal(vscode.ViewColumn.Two)
88+
this.loaded = true
89+
}
8690
} else {
8791
this.panel = this.createWebviewPanel()
8892
}
@@ -106,6 +110,7 @@ class ReactWebView {
106110
// prevents destroying the window when it is in the background
107111
retainContextWhenHidden: true,
108112
}
113+
this.loaded = true
109114
return vscode.window.createWebviewPanel(viewType, title, vscode.ViewColumn.Two, config)
110115
}
111116

0 commit comments

Comments
 (0)