mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-04 04:10:33 +03:00
e4616f6840
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
31 lines
919 B
JavaScript
31 lines
919 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
var SettingsGeneralRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, {
|
|
titleToken: 'General',
|
|
|
|
classNames: ['settings-view-general'],
|
|
|
|
beforeModel: function () {
|
|
return this.get('session.user')
|
|
.then(this.transitionAuthor())
|
|
.then(this.transitionEditor());
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
return records.get('firstObject');
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
save: function () {
|
|
this.get('controller').send('save');
|
|
}
|
|
}
|
|
});
|
|
|
|
export default SettingsGeneralRoute;
|