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,14 +376,19 @@ window.addEventListener('message', async (event) => {
const sanitize_items = items => {
return items.map(item => {
// Check if the item is just '-'
if (item === '-') {
return '-';
}
// Otherwise, proceed as before
return {
html: item.label,
action: item.action,
items: item.items && sanitize_items(item.items),
items: item.items ? sanitizeItems(item.items) : undefined
};
});
};
// This array will store the menubar button elements
const menubar_buttons = [];