2
0
Fork 0
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:
Robin Ward 2013-05-28 11:08:32 -04:00
parent 55526e24d6
commit 57f97880e6
26 changed files with 101 additions and 124 deletions

View file

@ -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;