mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-16 12:16:09 +03:00
b4b5e2a3f5
fixes #5136 - wrap notification fetch with a user role check to remove console error - move author transition down to local route for users/user so that there's no infinite loop - replace all store calls to fetch the current user with the session user instead
29 lines
632 B
JavaScript
29 lines
632 B
JavaScript
import Ember from 'ember';
|
|
var CurrentUserSettings = Ember.Mixin.create({
|
|
transitionAuthor: function () {
|
|
var self = this;
|
|
|
|
return function (user) {
|
|
if (user.get('isAuthor')) {
|
|
return self.transitionTo('settings.users.user', user);
|
|
}
|
|
|
|
return user;
|
|
};
|
|
},
|
|
|
|
transitionEditor: function () {
|
|
var self = this;
|
|
|
|
return function (user) {
|
|
if (user.get('isEditor')) {
|
|
return self.transitionTo('settings.users');
|
|
}
|
|
|
|
return user;
|
|
};
|
|
}
|
|
});
|
|
|
|
export default CurrentUserSettings;
|