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,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 = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user