fix: Enabled the builtin single instance tauri plugin

This commit is contained in:
2026-06-30 16:26:17 -04:00
parent 4570cac5e5
commit 850a6c81a1
4 changed files with 102 additions and 5 deletions
+7 -1
View File
@@ -8,7 +8,13 @@ const INJECT_JS: &str = include_str!("../../src/inject.js");
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
tauri::Builder::default().plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
if let Some(w) = app.get_webview_window("main") {
let _ = w.show();
let _ = w.unminimize();
let _ = w.set_focus();
}
}))
.setup(|app| {
let show = MenuItem::with_id(app, "show", "Open", true, None::<&str>)?;
let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;