Support separator in the setMenubar API

This commit is contained in:
Nariman Jelveh 2024-06-02 10:21:11 -07:00
parent 233a2719c6
commit 6efff83616

View File

@ -376,10 +376,15 @@ window.addEventListener('message', async (event) => {
const sanitize_items = items => { const sanitize_items = items => {
return items.map(item => { return items.map(item => {
// Check if the item is just '-'
if (item === '-') {
return '-';
}
// Otherwise, proceed as before
return { return {
html: item.label, html: item.label,
action: item.action, action: item.action,
items: item.items && sanitize_items(item.items), items: item.items ? sanitizeItems(item.items) : undefined
}; };
}); });
}; };