fix: Enabled the builtin single instance tauri plugin
This commit is contained in:
@@ -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>)?;
|
||||
|
||||
Reference in New Issue
Block a user