FIX: Support for menu glyphs that are optional

This commit is contained in:
Robin Ward 2017-09-26 09:50:43 -04:00
parent faa37c3070
commit 9e17fd8907
1 changed files with 8 additions and 3 deletions

View File

@ -23,9 +23,14 @@ createWidget('user-menu-links', {
const glyphs = []; const glyphs = [];
if (extraGlyphs) { if (extraGlyphs) {
// yes glyphs.push(...extraGlyphs) is nicer, but pulling in extraGlyphs.forEach(g => {
// _toConsumableArray seems totally uneeded here if (typeof g === "function") {
glyphs.push.apply(glyphs, extraGlyphs); g = g(this);
}
if (g) {
glyphs.push(g);
}
});
} }
glyphs.push({ label: 'user.bookmarks', glyphs.push({ label: 'user.bookmarks',