travis-web/assets/scripts/app/controllers/current-user.coffee
2015-01-30 09:10:48 +01:00

14 lines
448 B
CoffeeScript

Controller = Ember.ObjectController.extend
sync: ->
@get('model').sync()
model: Ember.computed.alias('auth.currentUser')
syncingDidChange: (->
if (user = @get('model')) && user.get('isSyncing') && !user.get('syncedAt')
Ember.run.scheduleOnce 'routerTransitions', this, ->
@container.lookup('router:main').send('renderFirstSync')
).observes('isSyncing', 'auth.currentUser')
Travis.CurrentUserController = Controller