26 lines
756 B
Rust
26 lines
756 B
Rust
#![cfg_attr(
|
|
all(not(debug_assertions), target_os = "windows"),
|
|
windows_subsystem = "windows"
|
|
)]
|
|
|
|
use tauri::Manager;
|
|
// Create the command:
|
|
// This command must be async so that it doesn't run on the main thread.
|
|
#[tauri::command]
|
|
async fn close_splashscreen(window: tauri::Window) {
|
|
// Close splashscreen
|
|
if let Some(splashscreen) = window.get_window("splashscreen") {
|
|
splashscreen.close().unwrap();
|
|
}
|
|
// Show main window
|
|
window.get_window("main").unwrap().show().unwrap();
|
|
}
|
|
|
|
fn main() {
|
|
tauri::Builder::default()
|
|
.invoke_handler(tauri::generate_handler![close_splashscreen])
|
|
.plugin(tauri_plugin_store::Builder::default().build())
|
|
.run(tauri::generate_context!())
|
|
.expect("error while running tauri application");
|
|
}
|