fix user login state

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-06-22 23:31:46 +08:00
parent fea9cfba7f
commit 96d95fa08a
12 changed files with 182 additions and 81 deletions

View File

@@ -186,6 +186,10 @@ pub enum Data {
},
SystemInfo(Option<String>),
ClickTime(i64),
#[cfg(all(
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
MouseMoveTime(i64),
Authorize,
Close,
@@ -332,6 +336,10 @@ async fn handle(data: Data, stream: &mut Connection) {
let t = crate::server::CLICK_TIME.load(Ordering::SeqCst);
allow_err!(stream.send(&Data::ClickTime(t)).await);
}
#[cfg(all(
not(any(target_os = "android", target_os = "ios")),
feature = "flutter"
))]
Data::MouseMoveTime(_) => {
let t = crate::server::MOUSE_MOVE_TIME.load(Ordering::SeqCst);
allow_err!(stream.send(&Data::MouseMoveTime(t)).await);
@@ -345,13 +353,7 @@ async fn handle(data: Data, stream: &mut Connection) {
}
}
Data::OnlineStatus(_) => {
let x = config::ONLINE
.lock()
.unwrap()
.values()
.max()
.unwrap_or(&0)
.clone();
let x = config::get_online_statue();
let confirmed = Config::get_key_confirmed();
allow_err!(stream.send(&Data::OnlineStatus(Some((x, confirmed)))).await);
}