Prevent duplicate desktop model sessions and record calibration evidence
This commit is contained in:
1 parent
8498c5401c
commit
fb8b45dcc9
7 files changed
+206
-10
No files matched your search
@@ -6,6 +6,7 @@ compile_error!("Release desktop builds require --features custom-protocol to emb
|
||||
mod ai_commands;
|
||||
mod appearance;
|
||||
mod data_directory;
|
||||
mod instance;
|
||||
mod model_download;
|
||||
mod semantic_commands;
|
||||
mod settings;
|
||||
@@ -545,16 +546,22 @@ fn start_folder_watching(
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut context = tauri::generate_context!();
|
||||
context.config_mut().identifier = instance::profile_identifier(
|
||||
&context.config().identifier,
|
||||
std::env::var_os("SEARCHI_DATA_DIR"),
|
||||
)
|
||||
.expect("searchi profile identity could not be resolved");
|
||||
tauri::Builder::default()
|
||||
// Detect duplicates before any model, database, watcher or other plugin starts.
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
|
||||
instance::focus_search(app);
|
||||
}))
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.plugin(tauri_plugin_global_shortcut::Builder::new().with_handler(|app, _, event| {
|
||||
if event.state == ShortcutState::Pressed {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
let result = window.show().and_then(|_| window.unminimize()).and_then(|_| window.set_focus());
|
||||
if let Err(error) = result { eprintln!("Could not focus Searchi: {error}"); }
|
||||
let _ = window.emit("focus-search", ());
|
||||
}
|
||||
instance::focus_search(app);
|
||||
}
|
||||
}).build())
|
||||
.setup(|app| {
|
||||
@@ -687,7 +694,7 @@ fn main() {
|
||||
hybrid_search,
|
||||
hybrid_search_measured
|
||||
])
|
||||
.build(tauri::generate_context!())
|
||||
.build(context)
|
||||
.expect("Searchi desktop could not start")
|
||||
.run(|app, event| {
|
||||
if matches!(event, tauri::RunEvent::Exit) {
|
||||
|
||||
Reference in new issue
Block a user