flutter version allow hide cm

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-11-23 09:41:05 +08:00
parent c26e86288d
commit 8b4d50f3fb
37 changed files with 198 additions and 44 deletions

View File

@@ -39,6 +39,7 @@ lazy_static::lazy_static! {
static ref OPTIONS : Arc<Mutex<HashMap<String, String>>> = Arc::new(Mutex::new(Config::get_options()));
static ref ASYNC_JOB_STATUS : Arc<Mutex<String>> = Default::default();
static ref TEMPORARY_PASSWD : Arc<Mutex<String>> = Arc::new(Mutex::new("".to_owned()));
pub static ref OPTION_SYNCED : Arc<Mutex<bool>> = Default::default();
}
#[cfg(not(any(target_os = "android", target_os = "ios")))]
@@ -924,7 +925,8 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
UI_STATUS.lock().unwrap().2 = v;
}
Ok(Some(ipc::Data::Options(Some(v)))) => {
*OPTIONS.lock().unwrap() = v
*OPTIONS.lock().unwrap() = v;
*OPTION_SYNCED.lock().unwrap() = true;
}
Ok(Some(ipc::Data::Config((name, Some(value))))) => {
if name == "id" {
@@ -967,6 +969,11 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
}
}
#[allow(dead_code)]
pub fn option_synced() -> bool {
OPTION_SYNCED.lock().unwrap().clone()
}
#[cfg(any(target_os = "android", target_os = "ios", feature = "flutter"))]
#[tokio::main(flavor = "current_thread")]
pub(crate) async fn send_to_cm(data: &ipc::Data) {