@@ -88,7 +88,7 @@ type Props = {
8888}
8989
9090export const Main : React . FC < Props > = ( props ) => {
91- const [ all_web_configurations , set_all_web_configurations ] =
91+ const [ web_configurations , set_web_configurations ] =
9292 useState < WebConfiguration [ ] > ( )
9393 const [
9494 selected_web_configuration_name_by_mode ,
@@ -111,7 +111,7 @@ export const Main: React.FC<Props> = (props) => {
111111 const message = event . data as BackendMessage
112112 switch ( message . command ) {
113113 case 'WEB_CONFIGURATIONS' :
114- set_all_web_configurations (
114+ set_web_configurations (
115115 ( message as WebConfigurationsMessage ) . web_configurations
116116 )
117117 set_selected_web_configuration_name_by_mode (
@@ -204,12 +204,12 @@ export const Main: React.FC<Props> = (props) => {
204204 }
205205
206206 const handle_toggle_web_configuration_pinned = ( name : string ) => {
207- if ( all_web_configurations ) {
208- const updated_web_configurations = all_web_configurations . map ( ( p ) =>
207+ if ( web_configurations ) {
208+ const updated_web_configurations = web_configurations . map ( ( p ) =>
209209 p . name == name ? { ...p , is_pinned : ! p . is_pinned } : p
210210 )
211211
212- set_all_web_configurations ( updated_web_configurations )
212+ set_web_configurations ( updated_web_configurations )
213213
214214 post_message ( props . vscode , {
215215 command : 'TOGGLE_PINNED_WEB_CONFIGURATION' ,
@@ -244,8 +244,8 @@ export const Main: React.FC<Props> = (props) => {
244244 const handle_web_configurations_reorder = (
245245 reordered_web_configurations : WebConfiguration [ ]
246246 ) => {
247- if ( all_web_configurations ) {
248- set_all_web_configurations ( reordered_web_configurations )
247+ if ( web_configurations ) {
248+ set_web_configurations ( reordered_web_configurations )
249249 }
250250
251251 post_message ( props . vscode , {
@@ -350,7 +350,7 @@ export const Main: React.FC<Props> = (props) => {
350350 }
351351
352352 const handle_web_configuration_edit = ( name : string ) => {
353- const web_configuration = all_web_configurations ?. find (
353+ const web_configuration = web_configurations ?. find (
354354 ( config ) => config . name == name
355355 )
356356 if ( web_configuration ) props . on_web_configuration_edit ( web_configuration )
@@ -471,7 +471,7 @@ export const Main: React.FC<Props> = (props) => {
471471 }
472472
473473 if (
474- all_web_configurations === undefined ||
474+ web_configurations === undefined ||
475475 props . api_configurations === undefined ||
476476 ask_about_files_history === undefined ||
477477 edit_files_history === undefined ||
@@ -484,18 +484,13 @@ export const Main: React.FC<Props> = (props) => {
484484 const selected_web_configuration_name =
485485 selected_web_configuration_name_by_mode ?. [ props . web_prompt_type ]
486486
487- const api_configurations =
488- props . target == TARGET . API && props . api_configurations
489- ? props . api_configurations
490- : [ ]
491-
492487 return (
493488 < MainView
494489 scroll_reset_key = { props . scroll_reset_key }
495490 on_show_home = { props . on_show_home }
496491 initialize_chats = { handle_initialize_chats }
497492 on_copy = { handle_copy }
498- api_configurations = { api_configurations }
493+ api_configurations = { props . api_configurations }
499494 on_api_configuration_click = { handle_api_configuration_click }
500495 on_api_configurations_reorder = { handle_api_configurations_reorder }
501496 on_toggle_pinned_api_configuration = {
@@ -511,7 +506,7 @@ export const Main: React.FC<Props> = (props) => {
511506 on_hash_sign_click = { handle_hash_sign_click }
512507 on_slash_click = { handle_slash_click }
513508 is_connected = { props . is_connected }
514- web_configurations = { all_web_configurations || [ ] }
509+ web_configurations = { web_configurations || [ ] }
515510 on_create_web_configuration = { handle_create_web_configuration }
516511 currently_open_file_path = { props . currently_open_file_path }
517512 on_quick_action_click = { handle_quick_action_click }
0 commit comments