mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
7bfe6e9db7
closes #3162 - removes injection of user object in application route's beforeModel - removes injection/cleanup of user object in signedIn/signedOut actions - removes loading of user and passing to signedIn action in signup/setup controllers - adds 'user' property to session object - updates header nav to reference session.user - sets model of settings/user route to session.user and forces reload - on leaving settings/user, rollback any unsaved changes
21 lines
515 B
JavaScript
21 lines
515 B
JavaScript
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;
|