debug, mobile, connection login state

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-06-23 12:49:36 +08:00
parent ed53fa37fc
commit 71db0e99b5
3 changed files with 11 additions and 38 deletions

View File

@ -1197,17 +1197,11 @@ pub fn main_check_mouse_time() {
} }
pub fn main_get_mouse_time() -> f64 { pub fn main_get_mouse_time() -> f64 {
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
{ {
get_mouse_time() get_mouse_time()
} }
#[cfg(not(all( #[cfg(any(target_os = "android", target_os = "ios"))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
)))]
{ {
0.0 0.0
} }

View File

@ -216,7 +216,7 @@ impl OidcSession {
let query_timeout = OIDC_SESSION.read().unwrap().query_timeout; let query_timeout = OIDC_SESSION.read().unwrap().query_timeout;
while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout { while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout {
match Self::query(&code_url.code, &id, &uuid) { match Self::query(&code_url.code, &id, &uuid) {
Ok(HbbHttpResponse::<_>::Data(mut auth_body)) => { Ok(HbbHttpResponse::<_>::Data(auth_body)) => {
if remember_me { if remember_me {
LocalConfig::set_option( LocalConfig::set_option(
"access_token".to_owned(), "access_token".to_owned(),

View File

@ -38,10 +38,7 @@ pub struct UiStatus {
pub status_num: i32, pub status_num: i32,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
pub key_confirmed: bool, pub key_confirmed: bool,
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
pub mouse_time: i64, pub mouse_time: i64,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
pub id: String, pub id: String,
@ -52,10 +49,7 @@ lazy_static::lazy_static! {
status_num: 0, status_num: 0,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
key_confirmed: false, key_confirmed: false,
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
mouse_time: 0, mouse_time: 0,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
id: "".to_owned(), id: "".to_owned(),
@ -417,20 +411,14 @@ pub fn is_installed_lower_version() -> bool {
} }
#[inline] #[inline]
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
pub fn get_mouse_time() -> f64 { pub fn get_mouse_time() -> f64 {
UI_STATUS.lock().unwrap().mouse_time as f64 UI_STATUS.lock().unwrap().mouse_time as f64
} }
#[inline] #[inline]
pub fn check_mouse_time() { pub fn check_mouse_time() {
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
{ {
let sender = SENDER.lock().unwrap(); let sender = SENDER.lock().unwrap();
allow_err!(sender.send(ipc::Data::MouseMoveTime(0))); allow_err!(sender.send(ipc::Data::MouseMoveTime(0)));
@ -891,7 +879,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
let mut mouse_time = 0; let mut mouse_time = 0;
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
let mut id = "".to_owned(); let mut id = "".to_owned();
#[cfg(target_os="windows")] #[cfg(target_os = "windows")]
let mut enable_file_transfer = "".to_owned(); let mut enable_file_transfer = "".to_owned();
loop { loop {
@ -905,10 +893,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
log::error!("ipc connection closed: {}", err); log::error!("ipc connection closed: {}", err);
break; break;
} }
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
Ok(Some(ipc::Data::MouseMoveTime(v))) => { Ok(Some(ipc::Data::MouseMoveTime(v))) => {
mouse_time = v; mouse_time = v;
UI_STATUS.lock().unwrap().mouse_time = v; UI_STATUS.lock().unwrap().mouse_time = v;
@ -948,10 +933,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
status_num: x as _, status_num: x as _,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
key_confirmed: _c, key_confirmed: _c,
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
mouse_time, mouse_time,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
id: id.clone(), id: id.clone(),
@ -983,10 +965,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
status_num: -1, status_num: -1,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
key_confirmed, key_confirmed,
#[cfg(all( #[cfg(not(any(target_os = "android", target_os = "ios")))]
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
mouse_time, mouse_time,
#[cfg(not(feature = "flutter"))] #[cfg(not(feature = "flutter"))]
id: id.clone(), id: id.clone(),