Skip to content

Commit 86d0aaa

Browse files
authored
fix(core): notification panic on Windows, closes #917 (#2011)
1 parent 2a5ba7f commit 86d0aaa

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Run the `notification.show()` method on a dedicated async task to prevent a panic on Windows.

core/tauri/src/api/notification.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ impl Notification {
8181
notification.app_id(&self.identifier);
8282
}
8383
}
84-
notification.show()?;
84+
85+
crate::async_runtime::spawn(async move {
86+
notification.show().expect("failed to show notification");
87+
});
88+
8589
Ok(())
8690
}
8791
}

0 commit comments

Comments
 (0)