FIX: Support for menu glyphs that are optional
This commit is contained in:
parent
faa37c3070
commit
9e17fd8907
|
@ -23,9 +23,14 @@ createWidget('user-menu-links', {
|
|||
const glyphs = [];
|
||||
|
||||
if (extraGlyphs) {
|
||||
// yes glyphs.push(...extraGlyphs) is nicer, but pulling in
|
||||
// _toConsumableArray seems totally uneeded here
|
||||
glyphs.push.apply(glyphs, extraGlyphs);
|
||||
extraGlyphs.forEach(g => {
|
||||
if (typeof g === "function") {
|
||||
g = g(this);
|
||||
}
|
||||
if (g) {
|
||||
glyphs.push(g);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
glyphs.push({ label: 'user.bookmarks',
|
||||
|
|
Loading…
Reference in New Issue