Inside that command, I take the users directory, create a config and save it, close the welcome window and spawn main.
#[tauri::command]
fn save_notes_dir(handle: AppHandle, notes_dir: PathBuf) {
if let Some(welcome) = handle.get_window("welcome") {
if let Ok(_) = welcome.close() {
let config = Config::new(notes_dir);
if let Ok(_) = config.store_config(&handle.path_resolver()) {
if let Ok(_) = welcome.close() {
spawn_main(handle, config.notes_dir, 1920.0, 1080.0);
}
}
}
}
}
Now, when the program goes this route, it gets here, closes the welcome window and then when its supposed to create the main window, it calls the function, inside that function it spawns the thread, but no window appears and the program stops, Why?