mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
Support separator in the setMenubar
API
This commit is contained in:
parent
233a2719c6
commit
6efff83616
@ -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
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user