Skip to content

Commit c3dcd8a

Browse files
committed
Refactor websocket connection status change handler to simplify nested structure
1 parent 99743c1 commit c3dcd8a

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

‎apps/editor/src/views/panel/backend/panel-provider.ts‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,14 @@ export class PanelProvider implements vscode.WebviewViewProvider {
331331
this.context = params.context
332332
this.websocket_server_instance = params.websocket_server_instance
333333

334-
params.websocket_server_instance.on_connection_status_change(
335-
(connected) => {
336-
if (this._webview_view) {
337-
this.send_message({
338-
command: 'CONNECTION_STATUS',
339-
connected
340-
})
341-
}
334+
this.websocket_server_instance.on_connection_status_change((connected) => {
335+
if (this._webview_view) {
336+
this.send_message({
337+
command: 'CONNECTION_STATUS',
338+
connected
339+
})
342340
}
343-
)
341+
})
344342

345343
this.edit_context_instructions = this._load_instructions(
346344
INSTRUCTIONS_EDIT_CONTEXT_STATE_KEY

0 commit comments

Comments
 (0)