mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
fda94fedab
no issue - https://github.com/ember-cli/eslint-plugin-ember/blob/HEAD/docs/rules/alias-model-in-controller.md - replace `model` with a meaningful property name everywhere possible - refactor `design` and `general` settings controllers to use a directly injected settings service rather than passing it in as a "model" to be more explicit
23 lines
901 B
JavaScript
23 lines
901 B
JavaScript
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
import Controller from '@ember/controller';
|
|
import {computed} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Controller.extend({
|
|
dropdown: service(),
|
|
session: service(),
|
|
settings: service(),
|
|
ui: service(),
|
|
|
|
showNavMenu: computed('currentPath', 'session.{isAuthenticated,user.isFulfilled}', function () {
|
|
// we need to defer showing the navigation menu until the session.user
|
|
// promise has fulfilled so that gh-user-can-admin has the correct data
|
|
if (!this.get('session.isAuthenticated') || !this.get('session.user.isFulfilled')) {
|
|
return false;
|
|
}
|
|
|
|
return (this.get('currentPath') !== 'error404' || this.get('session.isAuthenticated'))
|
|
&& !this.get('currentPath').match(/(signin|signup|setup|reset)/);
|
|
})
|
|
});
|