Fix Windows build: AppHandle borrow, event lifetime, subscribe signature

This commit is contained in:
Aether 2026-02-23 19:40:15 +00:00
parent 3647f19b59
commit fce171808e
No known key found for this signature in database
GPG Key ID: 95AFEE837E39AFD2
3 changed files with 4 additions and 4 deletions

View File

@ -265,7 +265,7 @@ pub fn subscribe_event(
callback_id: String, callback_id: String,
event_bus: State<'_, Arc<EventBus>> event_bus: State<'_, Arc<EventBus>>
) -> Result<String, String> { ) -> Result<String, String> {
let id = event_bus.subscribe(&event_type, callback_id); let id = event_bus.subscribe(event_type, callback_id);
Ok(id) Ok(id)
} }

View File

@ -55,14 +55,14 @@ impl EventBus {
pub fn subscribe( pub fn subscribe(
&self, &self,
event_type: &str, event_type: String,
handler_id: String handler_id: String
) -> SubscriptionId { ) -> SubscriptionId {
let id = Uuid::new_v4().to_string(); let id = Uuid::new_v4().to_string();
// Store subscription info - actual handler would be connected via frontend // Store subscription info - actual handler would be connected via frontend
let mut subs = self.subscribers.lock().unwrap(); let mut subs = self.subscribers.lock().unwrap();
let handlers = subs.entry(event_type.to_string()).or_insert_with(Vec::new); let handlers = subs.entry(event_type.clone()).or_insert_with(Vec::new);
// Create a handler that emits to frontend // Create a handler that emits to frontend
let handler = Box::new(move |data: Value| { let handler = Box::new(move |data: Value| {

View File

@ -98,7 +98,7 @@ fn main() {
window::setup_main_window(&main_window); window::setup_main_window(&main_window);
// Create overlay window (hidden initially) // Create overlay window (hidden initially)
window::create_overlay_window(app.handle()); window::create_overlay_window(&app.handle());
// Register default hotkeys // Register default hotkeys
hotkey_manager.register_defaults(); hotkey_manager.register_defaults();