#Is there a way to cancel single instance?

3 messages · Page 1 of 1 (latest)

idle crown
#

I currently do the following:

.plugin(tauri_plugin_single_instance::init(|app, _, _| {
            let window = app.get_webview_window("main").expect("no main window");
            window.unminimize().ok();
            window.set_focus().ok();
}))

But I would really love to be able to bail out of this when I am launching a development build while having the production app open. I already have the code to determine if the build types don't match (release != dev) by comparing state, but is there a way to stop this plugin from preventing app startup?

sullen bridge
#

Just throwing out a thought not sure how single-instance works, but maybe if you conditionally give your dev app a different process name it wouldn't be triggered?

idle crown