Merge pull request #151 from Sertonix/unmerge-menu-seperators

unmerge menus ignore seperators
This commit is contained in:
Maurício Szabo 2022-11-18 22:59:12 -03:00 committed by GitHub
commit 2d88e44736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ function unmerge(menu, item) {
}
}
if (matchingItem.submenu == null || matchingItem.submenu.length === 0) {
if (matchingItem.submenu == null || matchingItem.submenu.filter( ({type}) => type !== 'separator' ).length === 0) {
menu.splice(matchingItemIndex, 1);
}
}