chore: update
This commit is contained in:
@@ -139,6 +139,24 @@ impl Timer {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// pub async fn add_update_tray_menu_task(&self) -> Result<()> {
|
||||
// let tid = self.timer_count.fetch_add(1, Ordering::SeqCst);
|
||||
// let delay_timer = self.delay_timer.write();
|
||||
// let task = TaskBuilder::default()
|
||||
// .set_task_id(tid)
|
||||
// .set_maximum_parallel_runnable_num(1)
|
||||
// .set_frequency_repeated_by_seconds(5)
|
||||
// .spawn_async_routine(|| async move {
|
||||
// logging!(info, Type::Timer, "Updating tray menu");
|
||||
// core::tray::Tray::global().update_tray_display().await
|
||||
// })
|
||||
// .context("failed to create update tray menu timer task")?;
|
||||
// delay_timer
|
||||
// .add_task(task)
|
||||
// .context("failed to add update tray menu timer task")?;
|
||||
// Ok(())
|
||||
// }
|
||||
|
||||
/// Refresh timer tasks with better error handling
|
||||
pub async fn refresh(&self) -> Result<()> {
|
||||
// Generate diff outside of lock to minimize lock contention
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use once_cell::sync::OnceCell;
|
||||
use tauri::Emitter;
|
||||
use tauri::{Emitter};
|
||||
use tauri::tray::TrayIconBuilder;
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod speed_rate;
|
||||
@@ -193,6 +193,7 @@ impl Tray {
|
||||
pub async fn init(&self) -> Result<()> {
|
||||
let app_handle = handle::Handle::app_handle();
|
||||
self.create_tray_from_handle(app_handle).await?;
|
||||
// core::timer::Timer::global().add_update_tray_menu_task().await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user