From 71db0e99b5c40281d7c348812845da40b1c54419 Mon Sep 17 00:00:00 2001 From: dignow Date: Fri, 23 Jun 2023 12:49:36 +0800 Subject: [PATCH] debug, mobile, connection login state Signed-off-by: dignow --- src/flutter_ffi.rs | 10 ++-------- src/hbbs_http/account.rs | 2 +- src/ui_interface.rs | 37 ++++++++----------------------------- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 8f1b2005d..f3a7239f7 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -1197,17 +1197,11 @@ pub fn main_check_mouse_time() { } pub fn main_get_mouse_time() -> f64 { - #[cfg(all( - not(any(target_os = "android", target_os = "ios")), - feature = "flutter" - ))] + #[cfg(not(any(target_os = "android", target_os = "ios")))] { get_mouse_time() } - #[cfg(not(all( - not(any(target_os = "android", target_os = "ios")), - feature = "flutter" - )))] + #[cfg(any(target_os = "android", target_os = "ios"))] { 0.0 } diff --git a/src/hbbs_http/account.rs b/src/hbbs_http/account.rs index a2ef53029..e958bf636 100644 --- a/src/hbbs_http/account.rs +++ b/src/hbbs_http/account.rs @@ -216,7 +216,7 @@ impl OidcSession { let query_timeout = OIDC_SESSION.read().unwrap().query_timeout; while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout { match Self::query(&code_url.code, &id, &uuid) { - Ok(HbbHttpResponse::<_>::Data(mut auth_body)) => { + Ok(HbbHttpResponse::<_>::Data(auth_body)) => { if remember_me { LocalConfig::set_option( "access_token".to_owned(), diff --git a/src/ui_interface.rs b/src/ui_interface.rs index ffffc3778..16d26b48f 100644 --- a/src/ui_interface.rs +++ b/src/ui_interface.rs @@ -38,10 +38,7 @@ pub struct UiStatus { pub status_num: i32, #[cfg(not(feature = "flutter"))] pub key_confirmed: bool, - #[cfg(all( - not(any(target_os = "android", target_os = "ios")), - feature = "flutter" - ))] + #[cfg(not(any(target_os = "android", target_os = "ios")))] pub mouse_time: i64, #[cfg(not(feature = "flutter"))] pub id: String, @@ -52,10 +49,7 @@ lazy_static::lazy_static! { status_num: 0, #[cfg(not(feature = "flutter"))] key_confirmed: false, - #[cfg(all( - not(any(target_os = "android", target_os = "ios")), - feature = "flutter" - ))] + #[cfg(not(any(target_os = "android", target_os = "ios")))] mouse_time: 0, #[cfg(not(feature = "flutter"))] id: "".to_owned(), @@ -417,20 +411,14 @@ pub fn is_installed_lower_version() -> bool { } #[inline] -#[cfg(all( - not(any(target_os = "android", target_os = "ios")), - feature = "flutter" -))] +#[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn get_mouse_time() -> f64 { UI_STATUS.lock().unwrap().mouse_time as f64 } #[inline] pub fn check_mouse_time() { - #[cfg(all( - not(any(target_os = "android", target_os = "ios")), - feature = "flutter" - ))] + #[cfg(not(any(target_os = "android", target_os = "ios")))] { let sender = SENDER.lock().unwrap(); allow_err!(sender.send(ipc::Data::MouseMoveTime(0))); @@ -891,7 +879,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver { mouse_time = v; UI_STATUS.lock().unwrap().mouse_time = v; @@ -948,10 +933,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver