Skip to content

Commit 43230cb

Browse files
fix(core): menu remove js binding not working (#9219)
* Fix menu `remove` js binding not working * add change file [skip ci] --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
1 parent fb14633 commit 43230cb

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.changes/fix-menu-remove-api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:bug
3+
---
4+
5+
Fixes the menu plugin `remove` command signature.

core/tauri/src/menu/plugin.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,19 +536,19 @@ fn insert<R: Runtime>(
536536
#[command(root = "crate")]
537537
fn remove<R: Runtime>(
538538
app: AppHandle<R>,
539-
menu_rid: ResourceId,
540-
menu_kind: ItemKind,
539+
rid: ResourceId,
540+
kind: ItemKind,
541541
item: (ResourceId, ItemKind),
542542
) -> crate::Result<()> {
543543
let resources_table = app.resources_table();
544544
let (rid, kind) = item;
545-
match menu_kind {
545+
match kind {
546546
ItemKind::Menu => {
547-
let menu = resources_table.get::<Menu<R>>(menu_rid)?;
547+
let menu = resources_table.get::<Menu<R>>(rid)?;
548548
do_menu_item!(resources_table, rid, kind, |i| menu.remove(&*i))?;
549549
}
550550
ItemKind::Submenu => {
551-
let submenu = resources_table.get::<Submenu<R>>(menu_rid)?;
551+
let submenu = resources_table.get::<Submenu<R>>(rid)?;
552552
do_menu_item!(resources_table, rid, kind, |i| submenu.remove(&*i))?;
553553
}
554554
_ => return Err(anyhow::anyhow!("unexpected menu item kind").into()),

0 commit comments

Comments
 (0)