Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-tauri/src/helpers/sys_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn generate_system_tray(app: &tauri::AppHandle) -> Result<TrayIcon, tauri::E
let image_path = app.path().resolve(icon_path, tauri::path::BaseDirectory::Resource)?;
let icon = Image::from_path(image_path).unwrap_or(app.default_window_icon().unwrap().clone());

TrayIconBuilder::with_id("main_tray")
TrayIconBuilder::with_id("clamav_gui_tray")
.tooltip(t("tray.tooltip"))
.icon(icon)
.menu(&menu)
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn set_language(
#[command]
#[specta(result)]
pub fn rebuild_tray(app: tauri::AppHandle) -> Result<(), String> {
app.remove_tray_by_id("main_tray");
app.remove_tray_by_id("clamav_gui_tray");
generate_system_tray(&app).map_err(|e|e.to_string())?;
Ok(())
}
Expand All @@ -129,7 +129,7 @@ pub fn update_tray_icon(app: tauri::AppHandle, state: RealTimeState) -> Result<(
.expect("Failed to load the icon"),
};
let icon = Image::from_path(icon_path).map_err(|e|e.to_string())?;
if let Some(tray) = app.tray_by_id("main_tray"){
if let Some(tray) = app.tray_by_id("clamav_gui_tray"){
tray.set_icon(Some(icon)).map_err(|e|e.to_string())?
}
Ok(())
Expand Down