Skip to content

Commit

Permalink
fix(core): notification panic on Windows, closes #917 (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jun 19, 2021
1 parent 2a5ba7f commit 86d0aaa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-notifications-on-windows.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Run the `notification.show()` method on a dedicated async task to prevent a panic on Windows.
6 changes: 5 additions & 1 deletion core/tauri/src/api/notification.rs
Expand Up @@ -81,7 +81,11 @@ impl Notification {
notification.app_id(&self.identifier);
}
}
notification.show()?;

crate::async_runtime::spawn(async move {
notification.show().expect("failed to show notification");
});

Ok(())
}
}

0 comments on commit 86d0aaa

Please sign in to comment.