From a9a0e626dbf1ed7d5c8c67f12e560ccca6bd9fe7 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 3 Jan 2017 17:56:13 +0800 Subject: [PATCH] FIX: Group page tabs not displaying for normal users. --- .../javascripts/discourse/controllers/group.js.es6 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/group.js.es6 b/app/assets/javascripts/discourse/controllers/group.js.es6 index 59bfb78fd44..126f8911dc8 100644 --- a/app/assets/javascripts/discourse/controllers/group.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group.js.es6 @@ -58,14 +58,8 @@ export default Ember.Controller.extend({ return this.get('tabs').filter(t => { let display = true; - if (this.currentUser) { - let admin = this.currentUser.admin; - - if (automatic && t.get('requiresGroupAdmin')) { - display = false; - } else { - display = admin || isGroupOwner; - } + if (this.currentUser && t.get('requiresGroupAdmin')) { + display = automatic ? false : (this.currentUser.admin || isGroupOwner); } else if (t.get('requiresGroupAdmin')) { display = false; }