Work in the background.

This commit is contained in:
CJ Pais 2025-02-17 12:12:48 -08:00
parent 0376fbe3e2
commit 870f517be2

View file

@ -9,6 +9,7 @@ use rig::streaming::StreamingChoice;
use rig::{completion::Prompt, providers::anthropic};
use std::sync::{Arc, Mutex};
use std::{thread, time};
use tauri::RunEvent;
use tauri_plugin_autostart::MacosLauncher;
use tauri_plugin_clipboard_manager::ClipboardExt;
@ -271,6 +272,13 @@ pub fn run() {
});
Ok(())
})
.on_window_event(|app, event| match event {
tauri::WindowEvent::CloseRequested { api, .. } => {
app.hide().unwrap();
api.prevent_close();
}
_ => {}
})
.invoke_handler(tauri::generate_handler![])
.run(tauri::generate_context!())
.expect("error while running tauri application");