centralize tauri event names

This commit is contained in:
2026-03-06 16:34:24 +08:00
parent 0e6b497cf6
commit 59253d286c
14 changed files with 155 additions and 20 deletions

View File

@@ -8,7 +8,7 @@ use tokio::sync::mpsc;
use tracing::{debug, error, info, warn};
use ts_rs::TS;
use crate::{get_app_handle, lock_r, state::FDOLL};
use crate::{get_app_handle, lock_r, services::app_events::AppEvents, state::FDOLL};
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[serde(rename_all = "camelCase")]
@@ -103,7 +103,7 @@ async fn init_cursor_tracking_i() -> Result<(), String> {
crate::services::ws::report_cursor_data(mapped_for_ws).await;
// 2. Broadcast to local windows
if let Err(e) = app_handle.emit("cursor-position", &positions) {
if let Err(e) = app_handle.emit(AppEvents::CursorPosition.as_str(), &positions) {
error!("Failed to emit cursor position event: {:?}", e);
}
}