@@ -7,8 +7,8 @@ use std::{env, io, process::Command};
77use tui:: widgets:: ListState ;
88pub ( super ) async fn subscribe_state ( app : & mut AppSub ) -> io:: Result < IFEXIT > {
99 if app. receiver . is_some ( ) {
10- if let Ok ( list ) = app. receiver . as_mut ( ) . unwrap ( ) . try_recv ( ) {
11- if !list . is_empty ( ) {
10+ if let Ok ( get_list ) = app. receiver . as_mut ( ) . unwrap ( ) . try_recv ( ) {
11+ if let Ok ( list ) = get_list {
1212 let mut storge: String = "[\n \n " . to_string ( ) ;
1313 let mut subs: Vec < Vec < String > > = Vec :: new ( ) ;
1414 let mut information: Vec < Vec < spider:: Information > > = Vec :: new ( ) ;
@@ -168,17 +168,13 @@ pub(super) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
168168 . unwrap_or_else ( |err| panic ! ( "{}" , err) ) ;
169169 // .collect();
170170 let ( sync_io_tx, sync_io_rx) =
171- tokio:: sync:: mpsc:: channel :: < Vec < Vec < String > > > ( 100 ) ;
171+ tokio:: sync:: mpsc:: channel :: < reqwest :: Result < Vec < Vec < String > > > > ( 100 ) ;
172172 app. receiver = Some ( sync_io_rx) ;
173173 let input = app. subscription . clone ( ) ;
174174 app. popinfomation = "Waiting for a moment" . to_string ( ) ;
175175 tokio:: spawn ( async move {
176176 let get_list = spider:: get_the_key ( input) . await ;
177- if let Ok ( list) = get_list {
178- sync_io_tx. send ( list) . await . unwrap ( ) ;
179- } else {
180- sync_io_tx. send ( vec ! [ ] ) . await . unwrap ( ) ;
181- }
177+ sync_io_tx. send ( get_list) . await . unwrap ( ) ;
182178 } ) ;
183179 }
184180 _ => { }
0 commit comments