Skip to content

Commit c9f6c38

Browse files
committed
Add backwards compatibility for browser connection status
1 parent 9d84d92 commit c9f6c38

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/editor/src/services/websocket-manager.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,12 @@ export class WebSocketManager {
258258
if (message.action === 'client-id-assignment') {
259259
this.client_id = message.client_id
260260
} else if (message.action === 'browser-connection-status') {
261-
this.has_connected_browser = message.has_connected_browser
261+
this.has_connected_browser =
262+
typeof message.has_connected_browser === 'boolean'
263+
? message.has_connected_browser
264+
: // Backwards compability 19.11.26
265+
Array.isArray((message as any).connected_browsers) &&
266+
(message as any).connected_browsers.length > 0
262267
this._on_connection_status_change.fire(this.has_connected_browser)
263268

264269
const config = vscode.workspace.getConfiguration('codeWebChat')

0 commit comments

Comments
 (0)