refactor
This commit is contained in:
parent
650dee20bb
commit
c6bb6955dc
@ -321,6 +321,9 @@ impl Connection {
|
|||||||
#[cfg(not(any(feature = "flatpak", feature = "appimage")))]
|
#[cfg(not(any(feature = "flatpak", feature = "appimage")))]
|
||||||
tx_desktop_ready: _tx_desktop_ready,
|
tx_desktop_ready: _tx_desktop_ready,
|
||||||
};
|
};
|
||||||
|
if !conn.on_open(addr).await {
|
||||||
|
return;
|
||||||
|
}
|
||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Err(err) =
|
if let Err(err) =
|
||||||
@ -331,10 +334,6 @@ impl Connection {
|
|||||||
});
|
});
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
start_channel(rx_to_cm, tx_from_cm);
|
start_channel(rx_to_cm, tx_from_cm);
|
||||||
|
|
||||||
if !conn.on_open(addr).await {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if !conn.keyboard {
|
if !conn.keyboard {
|
||||||
conn.send_permission(Permission::Keyboard, false).await;
|
conn.send_permission(Permission::Keyboard, false).await;
|
||||||
}
|
}
|
||||||
@ -818,9 +817,7 @@ impl Connection {
|
|||||||
Self::post_alarm_audit(
|
Self::post_alarm_audit(
|
||||||
AlarmAuditType::IpWhitelist, //"ip whitelist",
|
AlarmAuditType::IpWhitelist, //"ip whitelist",
|
||||||
true,
|
true,
|
||||||
json!({
|
json!({ "ip":addr.ip() }),
|
||||||
"ip":addr.ip(),
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
sleep(1.).await;
|
sleep(1.).await;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user