File tree Expand file tree Collapse file tree
views/panel/backend/message-handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -460,14 +460,14 @@ export class WebSocketManager {
460460 preset : Preset
461461 raw_instructions : string
462462 prompt_type : any
463- } ) : Promise < void > {
463+ } ) : Promise < boolean > {
464464 if ( ! this . has_connected_browsers ) {
465465 throw new Error ( 'Does not have connected browsers.' )
466466 }
467467
468468 const target_browser_id = await this . _select_browser ( )
469469 if ( target_browser_id === undefined ) {
470- return
470+ return false
471471 }
472472
473473 const config = vscode . workspace . getConfiguration ( 'codeWebChat' )
@@ -552,5 +552,6 @@ export class WebSocketManager {
552552 } )
553553
554554 this . client ?. send ( JSON . stringify ( message ) )
555+ return true
555556 }
556557}
Original file line number Diff line number Diff line change @@ -263,16 +263,18 @@ export const handle_preview_preset = async (
263263 new_url : message . preset . new_url
264264 }
265265
266- panel_provider . websocket_server_instance . preview_preset ( {
266+ const sent = await panel_provider . websocket_server_instance . preview_preset ( {
267267 instruction : text_to_send ,
268268 preset : preset_for_preview ,
269269 prompt_type : panel_provider . web_prompt_type ,
270270 raw_instructions : current_instructions
271271 } )
272272
273- panel_provider . send_message ( {
274- command : 'SHOW_AUTO_CLOSING_MODAL' ,
275- title : 'Opened in the connected browser' ,
276- type : 'success'
277- } )
273+ if ( sent ) {
274+ panel_provider . send_message ( {
275+ command : 'SHOW_AUTO_CLOSING_MODAL' ,
276+ title : 'Opened in the connected browser' ,
277+ type : 'success'
278+ } )
279+ }
278280}
You can’t perform that action at this time.
0 commit comments