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