Skip to content

Commit 3b12cbf

Browse files
authored
fix: make close_splashscreen command async to not crash the app (tauri-apps#460)
1 parent 62c6a6c commit 3b12cbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/guides/splashscreen.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ If you are waiting for your web code, you'll want to create a `close_splashscree
3636
```rust title=src-tauri/main.rs
3737
use tauri::Manager;
3838
// Create the command:
39+
// This command must be async so that it doesn't run on the main thread.
3940
#[tauri::command]
40-
fn close_splashscreen(window: tauri::Window) {
41+
async fn close_splashscreen(window: tauri::Window) {
4142
// Close splashscreen
4243
if let Some(splashscreen) = window.get_window("splashscreen") {
4344
splashscreen.close().unwrap();

0 commit comments

Comments
 (0)