Ghost/core/client/routes/settings/users/user.js

22 lines
515 B
JavaScript
Raw Normal View History

var SettingsUserRoute = Ember.Route.extend({
model: function () {
return this.session.get('user').then(function (user) {
user.reload();
return user;
});
},
deactivate: function () {
this._super();
// we want to revert any unsaved changes on exit
this.session.get('user').then(function (user) {
if (user.get('isDirty')) {
user.rollback();
}
});
}
});
export default SettingsUserRoute;