diff --git a/desktop-client/src-tauri/src/lib.rs b/desktop-client/src-tauri/src/lib.rs index 026cda6..ed19605 100644 --- a/desktop-client/src-tauri/src/lib.rs +++ b/desktop-client/src-tauri/src/lib.rs @@ -264,7 +264,7 @@ fn clear_session(app: AppHandle, state: State<'_, AppState>) -> Result<(), Strin } #[tauri::command] -async fn sync_profile(app: AppHandle, state: State<'_, AppState>) -> Result { +async fn sync_profile(app: AppHandle, _state: State<'_, AppState>) -> Result { let session_state = sync_current_session(&app).await?; refresh_tray_menu(&app); Ok(session_state.enrollment) @@ -666,11 +666,9 @@ pub fn run() { refresh_tray_menu(app.handle()); let app_handle = app.handle().clone(); - tauri::async_runtime::spawn(async move { - loop { - refresh_tray_menu(&app_handle); - tauri::async_runtime::sleep(std::time::Duration::from_secs(5)).await; - } + std::thread::spawn(move || loop { + refresh_tray_menu(&app_handle); + std::thread::sleep(std::time::Duration::from_secs(5)); }); Ok(())