diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 73fbdc9d1..8f1b2005d 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -689,7 +689,7 @@ pub fn main_get_connect_status() -> String { if state > 0 { state = 1; } - serde_json::json!({ "status_num": get_online_statue() }).to_string() + serde_json::json!({ "status_num": state }).to_string() } } @@ -1197,15 +1197,20 @@ pub fn main_check_mouse_time() { } pub fn main_get_mouse_time() -> f64 { - let mut mouse_time = 0.0; #[cfg(all( not(any(target_os = "android", target_os = "ios")), feature = "flutter" ))] { - mouse_time = get_mouse_time(); + get_mouse_time() + } + #[cfg(not(all( + not(any(target_os = "android", target_os = "ios")), + feature = "flutter" + )))] + { + 0.0 } - mouse_time } pub fn main_wol(id: String) { diff --git a/src/ui_interface.rs b/src/ui_interface.rs index 39930fa4b..ffffc3778 100644 --- a/src/ui_interface.rs +++ b/src/ui_interface.rs @@ -438,6 +438,7 @@ pub fn check_mouse_time() { } #[inline] +#[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn get_connect_status() -> UiStatus { UI_STATUS.lock().unwrap().clone() } @@ -884,10 +885,13 @@ pub fn get_hostname() -> String { #[cfg(not(any(target_os = "android", target_os = "ios")))] #[tokio::main(flavor = "current_thread")] async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver) { + #[cfg(not(feature = "flutter"))] let mut key_confirmed = false; let mut rx = rx; let mut mouse_time = 0; + #[cfg(not(feature = "flutter"))] let mut id = "".to_owned(); + #[cfg(target_os="windows")] let mut enable_file_transfer = "".to_owned(); loop { @@ -924,7 +928,10 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver { if name == "id" { - id = value; + #[cfg(not(feature = "flutter"))] + { + id = value; + } } else if name == "temporary-password" { *TEMPORARY_PASSWD.lock().unwrap() = value; } @@ -933,6 +940,10 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver 0 { x = 1 } + #[cfg(not(feature = "flutter"))] + { + key_confirmed = _c; + } *UI_STATUS.lock().unwrap() = UiStatus { status_num: x as _, #[cfg(not(feature = "flutter"))]