diff --git a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 index c944c40203e..f0e5319eb61 100644 --- a/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/hamburger-menu.js.es6 @@ -3,6 +3,8 @@ import { h } from 'virtual-dom'; import DiscourseURL from 'discourse/lib/url'; import { ajax } from 'discourse/lib/ajax'; +const flatten = array => [].concat.apply([], array); + createWidget('priority-faq-link', { tagName: 'a.faq-priority.widget-link', @@ -105,8 +107,7 @@ export default createWidget('hamburger-menu', { links.push({ route: 'tags', label: 'tagging.tags' }); } - const extraLinks = applyDecorators(this, 'generalLinks', this.attrs, this.state); - + const extraLinks = flatten(applyDecorators(this, 'generalLinks', this.attrs, this.state)); return links.concat(extraLinks).map(l => this.attach('link', l)); }, @@ -165,7 +166,7 @@ export default createWidget('hamburger-menu', { if (currentUser && currentUser.staff) { results.push(this.attach('menu-links', { contents: () => { - const extraLinks = applyDecorators(this, 'admin-links', this.attrs, this.state) || []; + const extraLinks = flatten(applyDecorators(this, 'admin-links', this.attrs, this.state)); return this.adminLinks().concat(extraLinks); }})); }