diff --git a/src/js/contextmenu.js b/src/js/contextmenu.js index 3bb4ab9..c00dbf8 100644 --- a/src/js/contextmenu.js +++ b/src/js/contextmenu.js @@ -66,8 +66,11 @@ function showContextMenu(x, y, items) { click: async (e) => { e.stopPropagation(); try { - await handler(); - } finally { + if ((await handler()) !== false) { + cleanupContextMenu(); + } + } catch (err) { + console.error("[ContextMenu] Error:", err); cleanupContextMenu(); } }, @@ -223,6 +226,7 @@ function showQueueContextMenu(x, y, selectedIndices) { }, [STRINGS.CONTEXT_SORT]: () => { showContextMenu(x, y, getSortMenuItems()); + return false; // prevent cleanup, keep submenu open }, [STRINGS.CONTEXT_FAVORITE]: async () => { await Promise.all(