fix(core): notification panic on Windows, closes #917 (#2011)

This commit is contained in:
Lucas Fernandes Nogueira 2021-06-19 13:57:45 -03:00 committed by GitHub
parent 2a5ba7fe77
commit 86d0aaa021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Run the `notification.show()` method on a dedicated async task to prevent a panic on Windows.

View File

@ -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(())
}
}