feat: add governor crate for rate limiting and improve window/tray operation handling

This commit is contained in:
Tunglies
2025-12-27 20:27:49 +08:00
parent 2c1303c2bd
commit c41db51f81
6 changed files with 120 additions and 152 deletions

View File

@@ -132,6 +132,13 @@ pub fn set_app_core_mode<R: Runtime>(app: &tauri::AppHandle<R>, mode: impl Into<
spec.appinfo.app_core_mode = mode.into();
}
#[inline]
pub fn get_app_uptime<R: Runtime>(app: &tauri::AppHandle<R>) -> Instant {
let platform_spec = app.state::<RwLock<Platform>>();
let spec = platform_spec.read();
spec.appinfo.app_startup_time
}
#[inline]
pub fn is_current_app_handle_admin<R: Runtime>(app: &tauri::AppHandle<R>) -> bool {
let platform_spec = app.state::<RwLock<Platform>>();