diff options
author | Ty Dunn <ty@tydunn.com> | 2023-06-29 22:55:14 -0700 |
---|---|---|
committer | Ty Dunn <ty@tydunn.com> | 2023-06-29 22:55:14 -0700 |
commit | a388490f47b44bd693ae27ab99589fe7ac425c77 (patch) | |
tree | 2ead51756ef11e35232e5bf963586c0e71c04bf7 /extension/src/debugPanel.ts | |
parent | 8551e46491d84623559f536415f5e6aa46cda6af (diff) | |
parent | d47c4cafb856ffe2efd7d08ceddc8ceda475a8c6 (diff) | |
download | sncontinue-a388490f47b44bd693ae27ab99589fe7ac425c77.tar.gz sncontinue-a388490f47b44bd693ae27ab99589fe7ac425c77.tar.bz2 sncontinue-a388490f47b44bd693ae27ab99589fe7ac425c77.zip |
Merge branch 'main' of github.com:continuedev/continue
Diffstat (limited to 'extension/src/debugPanel.ts')
-rw-r--r-- | extension/src/debugPanel.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/extension/src/debugPanel.ts b/extension/src/debugPanel.ts index 4f3d097c..b176eee7 100644 --- a/extension/src/debugPanel.ts +++ b/extension/src/debugPanel.ts @@ -113,7 +113,13 @@ class WebsocketConnection { if (typeof message !== "string") { message = JSON.stringify(message); } - this._ws.send(message); + if (this._ws.readyState === WebSocket.OPEN) { + this._ws.send(message); + } else { + this._ws.addEventListener("open", () => { + this._ws.send(message); + }); + } } public close() { @@ -231,7 +237,9 @@ export function setupDebugPanel( apiUrl: getContinueServerUrl(), sessionId, vscMediaUrl, - dataSwitchOn: vscode.workspace.getConfiguration("continue").get<boolean>("dataSwitch") + dataSwitchOn: vscode.workspace + .getConfiguration("continue") + .get<boolean>("dataSwitch"), }); // // Listen for changes to server URL in settings @@ -249,10 +257,10 @@ export function setupDebugPanel( break; } case "toggleDataSwitch": { - // Set the setting in vscode + // Set the setting in vscode await vscode.workspace - .getConfiguration("continue") - .update("dataSwitch", data.on, vscode.ConfigurationTarget.Global); + .getConfiguration("continue") + .update("dataSwitch", data.on, vscode.ConfigurationTarget.Global); break; } case "websocketForwardingOpen": { |