mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Refactor: Instead of getting currentUser
from the Discourse namespace, use
`Discourse.User.current()`
This commit is contained in:
parent
55526e24d6
commit
57f97880e6
26 changed files with 101 additions and 124 deletions
|
@ -4,7 +4,7 @@
|
|||
@class AdminDashboardController
|
||||
@extends Ember.Controller
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminDashboardController = Ember.Controller.extend({
|
||||
loading: true,
|
||||
|
@ -12,11 +12,11 @@ Discourse.AdminDashboardController = Ember.Controller.extend({
|
|||
problemsCheckInterval: '1 minute ago',
|
||||
|
||||
foundProblems: function() {
|
||||
return(Discourse.currentUser.admin && this.get('problems') && this.get('problems').length > 0);
|
||||
return(Discourse.User.current('admin') && this.get('problems') && this.get('problems').length > 0);
|
||||
}.property('problems'),
|
||||
|
||||
thereWereProblems: function() {
|
||||
if(!Discourse.currentUser.admin) { return false }
|
||||
if(!Discourse.User.current('admin')) { return false }
|
||||
if( this.get('foundProblems') ) {
|
||||
this.set('hadProblems', true);
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue