lan discovery almost done

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou committed 2021-12-21 00:34:10 +08:00
1 parent 5682b088de
commit d00352f4e4
9 files changed
+93 -47

No files matched your search

+16
View File
@@ -389,6 +389,22 @@ pub fn get_id() -> String {
}
}
pub async fn get_id_async() -> String {
if let Ok(Some(v)) = get_config_async("id", 1_000).await {
// update salt also, so that next time reinstallation not causing first-time auto-login failure
if let Ok(Some(v2)) = get_config_async("salt", 1_000).await {
Config::set_salt(&v2);
}
if v != Config::get_id() {
Config::set_key_confirmed(false);
Config::set_id(&v);
}
v
} else {
Config::get_id()
}
}
pub fn get_password() -> String {
if let Ok(Some(v)) = get_config("password") {
Config::set_password(&v);