mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-08-02 13:48:15 +02:00
Added more logging
This commit is contained in:
parent
30b8fa0f36
commit
4d05a1be41
@ -1,4 +1,4 @@
|
||||
use tauri::{RunEvent, WindowEvent};
|
||||
use tauri::{RunEvent, WindowEvent, Manager};
|
||||
|
||||
mod utils;
|
||||
mod commands;
|
||||
@ -47,7 +47,25 @@ pub fn run() {
|
||||
cleanup_backend();
|
||||
// Allow the window to close
|
||||
}
|
||||
_ => {}
|
||||
// Handle file open events (macOS specific)
|
||||
#[cfg(target_os = "macos")]
|
||||
RunEvent::OpenUrl { url } => {
|
||||
add_log(format!("🔍 DEBUG: OpenUrl event received: {}", url));
|
||||
// Handle URL-based file opening
|
||||
if url.starts_with("file://") {
|
||||
let file_path = url.strip_prefix("file://").unwrap_or(&url);
|
||||
if file_path.ends_with(".pdf") {
|
||||
add_log(format!("📂 File opened via URL event: {}", file_path));
|
||||
set_opened_file(file_path.to_string());
|
||||
|
||||
// Emit event to frontend
|
||||
app_handle.emit_all("file-opened", file_path).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
add_log(format!("🔍 DEBUG: Unhandled event: {:?}", event));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
@ -19,7 +19,6 @@
|
||||
"fullscreen": false
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
|
Loading…
Reference in New Issue
Block a user