@@ -507,6 +507,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
507507 account. clone ( ) ,
508508 state. current_user_id . as_deref ( ) ,
509509 net_tx,
510+ ui_tx. clone ( ) ,
510511 move || {
511512 let _ = ui_tx_timeline. send ( UiCommand :: OpenTimeline ( timeline_type. clone ( ) ) ) ;
512513 } ,
@@ -798,6 +799,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
798799 account. clone ( ) ,
799800 state. current_user_id . as_deref ( ) ,
800801 net_tx,
802+ ui_tx. clone ( ) ,
801803 move || {
802804 let _ = ui_tx_timeline. send ( UiCommand :: OpenTimeline ( timeline_type. clone ( ) ) ) ;
803805 } ,
@@ -844,6 +846,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
844846 account. clone ( ) ,
845847 state. current_user_id . as_deref ( ) ,
846848 net_tx,
849+ ui_tx. clone ( ) ,
847850 move || {
848851 let _ = ui_tx_timeline. send ( UiCommand :: OpenTimeline ( timeline_type. clone ( ) ) ) ;
849852 } ,
@@ -881,6 +884,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
881884 } ;
882885 let ui_tx_timeline = ui_tx. clone ( ) ;
883886 let ui_tx_close = ui_tx. clone ( ) ;
887+ let ui_tx_dlg = ui_tx. clone ( ) ;
884888 let account_id_opt = next_max_id. as_ref ( ) . map ( |_| account_id. clone ( ) ) ;
885889 let profile_dlg_handle = state. profile_dialog . as_ref ( ) . map ( |pd| pd. dialog_handle ( ) ) ;
886890 let followers_parent: & dyn wxdragon:: window:: WxWidget =
@@ -893,6 +897,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
893897 total_count,
894898 account_id_opt,
895899 net_tx_dlg,
900+ ui_tx_dlg,
896901 move |account| {
897902 let timeline_type = TimelineType :: User {
898903 id : account. id . clone ( ) ,
@@ -961,6 +966,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
961966 } ;
962967 let ui_tx_timeline = ui_tx. clone ( ) ;
963968 let ui_tx_close = ui_tx. clone ( ) ;
969+ let ui_tx_dlg = ui_tx. clone ( ) ;
964970 let account_id_opt = next_max_id. as_ref ( ) . map ( |_| account_id. clone ( ) ) ;
965971 let profile_dlg_handle = state. profile_dialog . as_ref ( ) . map ( |pd| pd. dialog_handle ( ) ) ;
966972 let following_parent: & dyn wxdragon:: window:: WxWidget =
@@ -973,6 +979,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
973979 total_count,
974980 account_id_opt,
975981 net_tx_dlg,
982+ ui_tx_dlg,
976983 move |account| {
977984 let timeline_type = TimelineType :: User {
978985 id : account. id . clone ( ) ,
@@ -1253,11 +1260,20 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
12531260 live_region. announce ( & format ! ( "Search for '{query}' failed: {}" , summarize_api_error( err) ) ) ;
12541261 }
12551262 NetworkResponse :: ListsFetched { result : Ok ( lists) } => {
1256- if let Some ( dlg) = & state. manage_lists_dialog {
1263+ if let Some ( account_id) = state. pending_add_to_list_user . take ( ) {
1264+ if lists. is_empty ( ) {
1265+ live_region. announce ( "No lists found to add user to" ) ;
1266+ } else if let Some ( list) = dialogs:: show_list_selection_dialog ( frame, & lists, "Add to List" , "Add" )
1267+ {
1268+ if let Some ( handle) = & state. network_handle {
1269+ handle. send ( NetworkCommand :: AddListAccount { list_id : list. id , account_id } ) ;
1270+ }
1271+ }
1272+ } else if let Some ( dlg) = & state. manage_lists_dialog {
12571273 dlg. update_lists ( lists) ;
12581274 } else if lists. is_empty ( ) {
12591275 live_region. announce ( "No lists found" ) ;
1260- } else if let Some ( list) = dialogs:: show_list_selection_dialog ( frame, & lists) {
1276+ } else if let Some ( list) = dialogs:: show_list_selection_dialog ( frame, & lists, "Open List" , "Open" ) {
12611277 let timeline_type = TimelineType :: List { id : list. id , title : list. title } ;
12621278 dispatch_ui_command ! ( UiCommand :: OpenTimeline ( timeline_type) ) ;
12631279 }
@@ -1277,6 +1293,7 @@ pub fn process_network_responses(ctx: &mut NetworkResponseContext<'_>) {
12771293 | NetworkResponse :: ListAccountsFetched { result : Err ( err) , .. }
12781294 | NetworkResponse :: ListAccountAdded { result : Err ( err) , .. }
12791295 | NetworkResponse :: ListAccountRemoved { result : Err ( err) , .. } => {
1296+ state. pending_add_to_list_user = None ;
12801297 let parent: & dyn WxWidget = if let Some ( dlg) = & state. manage_list_members_dialog {
12811298 dlg. get_dialog ( )
12821299 } else if let Some ( dlg) = & state. manage_lists_dialog {
0 commit comments