diff --git a/docs/guides/features/splashscreen.md b/docs/guides/features/splashscreen.md index 4d04886d99..39f520647f 100644 --- a/docs/guides/features/splashscreen.md +++ b/docs/guides/features/splashscreen.md @@ -34,11 +34,11 @@ Now, your main window will be hidden and the splashscreen window will show when If you are waiting for your web code, you'll want to create a `close_splashscreen` [command](command). ```rust src-tauri/main.rs -use tauri::Manager; +use tauri::{Manager, Window}; // Create the command: // This command must be async so that it doesn't run on the main thread. #[tauri::command] -async fn close_splashscreen() { +async fn close_splashscreen(window: Window) { // Close splashscreen window.get_window("splashscreen").expect("no window labeled 'splashscreen' found").close().unwrap() // Show main window @@ -82,6 +82,7 @@ If you are waiting for Rust code to run, put it in the `setup` function handler ```rust src-tauri/main.rs use tauri::Manager; + fn main() { tauri::Builder::default() .setup(|app| {