@@ -5,6 +5,7 @@ use super::{Page, IFEXIT};
55use crossterm:: event:: { self , Event , KeyCode } ;
66use serde_json:: json;
77use std:: { env, io, process:: Command } ;
8+ use tui:: style:: Color ;
89use tui:: widgets:: ListState ;
910pub ( super ) async fn subscribe_state ( app : & mut AppSub ) -> io:: Result < IFEXIT > {
1011 if app. receiver . is_some ( ) {
@@ -50,6 +51,7 @@ pub(super) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
5051 app. receiver = None ;
5152 app. popinfomation = "Settings, e to edit, s to save" . to_string ( ) ;
5253 app. input_mode = InputMode :: Popup ;
54+ app. popupcolor = Color :: LightBlue ;
5355 }
5456 } else if let Event :: Key ( key) = event:: read ( ) ? {
5557 match app. input_mode {
@@ -165,12 +167,16 @@ pub(super) async fn subscribe_state(app: &mut AppSub) -> io::Result<IFEXIT> {
165167 subscribe_json. push_str ( "\n ]" ) ;
166168 utils:: create_json_file ( utils:: Save :: Subscribes , subscribe_json)
167169 . unwrap_or_else ( |err| panic ! ( "{}" , err) ) ;
170+ app. popinfomation = "Have saved" . to_string ( ) ;
168171 // .collect();
172+ }
173+ KeyCode :: Char ( 'r' ) => {
169174 let ( sync_io_tx, sync_io_rx) =
170175 tokio:: sync:: mpsc:: channel :: < reqwest:: Result < Vec < Vec < String > > > > ( 100 ) ;
171176 app. receiver = Some ( sync_io_rx) ;
172177 let input = app. subscription . clone ( ) ;
173178 app. popinfomation = "Waiting for a moment" . to_string ( ) ;
179+ app. popupcolor = Color :: LightYellow ;
174180 tokio:: spawn ( async move {
175181 let get_list = spider:: get_the_key ( input) . await ;
176182 sync_io_tx. send ( get_list) . await . unwrap ( ) ;
0 commit comments