feat(splashscreen): enhance startup sequence and splashscreen handling

This update improves the splashscreen management during application startup. The splashscreen will now remain visible for a minimum duration and will only close after the main application is ready, ensuring a smoother user experience.

- Introduced a new startup sequence to manage background tasks.
- Added error handling for splashscreen closure to maintain functionality.
- Optimized the timing for displaying and hiding the splashscreen.
This commit is contained in:
Christoph Brandau
2026-07-08 18:25:43 +02:00
parent 7e7c1b0b69
commit a072bba2e6
3 changed files with 107 additions and 18 deletions
+13 -5
View File
@@ -22,14 +22,22 @@ use git::{
use tauri::Manager;
#[tauri::command]
fn close_splashscreen(app: tauri::AppHandle) {
fn close_splashscreen(app: tauri::AppHandle) -> Result<(), String> {
if let Some(window) = app.get_webview_window("splashscreen") {
let _ = window.hide();
window
.destroy()
.map_err(|error| format!("failed to destroy splashscreen: {error}"))?;
}
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
window
.show()
.map_err(|error| format!("failed to show main window: {error}"))?;
let _ = window.set_focus();
}
if let Some(window) = app.get_webview_window("splashscreen") {
let _ = window.close();
}
Ok(())
}
#[tokio::main]