We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5053576 commit 51fa48fCopy full SHA for 51fa48f
crates/tauri/src/tray/mod.rs
@@ -598,6 +598,13 @@ impl<R: Runtime> TrayIcon<R> {
598
599
impl<R: Runtime> Resource for TrayIcon<R> {
600
fn close(self: std::sync::Arc<Self>) {
601
+ self
602
+ .app_handle
603
+ .state::<plugin::TrayIcons>()
604
+ .icons
605
+ .lock()
606
+ .unwrap()
607
+ .remove(&self.id.0);
608
self.app_handle.remove_tray_by_id(&self.id);
609
}
610
crates/tauri/src/tray/plugin.rs
@@ -19,8 +19,8 @@ use crate::{
19
20
use super::{TrayIcon, TrayIconEvent};
21
22
-struct TrayIcons {
23
- icons: Mutex<HashMap<String, ResourceId>>,
+pub(crate) struct TrayIcons {
+ pub(crate) icons: Mutex<HashMap<String, ResourceId>>,
24
25
26
#[derive(Deserialize)]
0 commit comments