travis-web/app/controllers/current-user.js
2016-01-04 13:15:15 +01:00

19 lines
529 B
JavaScript

import Ember from 'ember';
export default Ember.Controller.extend({
sync() {
return this.get('model').sync();
},
model: Ember.computed.alias('auth.currentUser'),
syncingDidChange: function() {
var user;
if ((user = this.get('model')) && user.get('isSyncing') && !user.get('syncedAt')) {
return Ember.run.scheduleOnce('routerTransitions', this, function() {
return this.container.lookup('router:main').send('renderFirstSync');
});
}
}.observes('isSyncing', 'auth.currentUser')
});