refactor(gui-client): more detailed tray menu update errors (#7328)

Just adding a bit more context to see which particular operation fails.
This commit is contained in:
Thomas Eizinger
2024-11-13 00:22:23 +00:00
committed by GitHub
parent 6f7f6a4f34
commit b230cf79fd

View File

@@ -126,8 +126,15 @@ impl Tray {
}
fn update(handle: tauri::tray::TrayIcon, app: &AppHandle, menu: &Menu) -> Result<()> {
handle.set_tooltip(Some(TOOLTIP))?;
handle.set_menu(Some(build_app_state(app, menu)?))?;
let menu = build_app_state(app, menu).context("Failed to build tray menu")?;
handle
.set_tooltip(Some(TOOLTIP))
.context("Failed to set tooltip")?;
handle
.set_menu(Some(menu))
.context("Failed to set tray menu")?;
Ok(())
}