[fix] single instance can't trigger hidden program
This commit is contained in:
@@ -42,10 +42,12 @@ fn main() {
|
|||||||
|
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_single_instance::init(|app, _, _| {
|
.plugin(tauri_plugin_single_instance::init(|app, _, _| {
|
||||||
let _ = app
|
let window = app
|
||||||
.get_webview_window("main")
|
.get_webview_window("main")
|
||||||
.expect("no main window")
|
.expect("no main window");
|
||||||
.set_focus();
|
|
||||||
|
window.show().expect("no main window, can't show");
|
||||||
|
window.set_focus().expect("no main window, can't set focus")
|
||||||
}))
|
}))
|
||||||
.plugin(tauri_plugin_deep_link::init())
|
.plugin(tauri_plugin_deep_link::init())
|
||||||
.plugin(tauri_plugin_valtio::init())
|
.plugin(tauri_plugin_valtio::init())
|
||||||
|
|||||||
Reference in New Issue
Block a user