mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-13 05:16:28 +03:00
d51f2bcf23
closes https://github.com/TryGhost/Admin/pull/2107 - updated related babel dependencies - bumped eslint - ran `yarn lint:js --fix` - added eslint ignore comments for some required non-camel-case properties
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
import classic from 'ember-classic-decorator';
|
|
import {computed} from '@ember/object';
|
|
import {reads} from '@ember/object/computed';
|
|
import {inject as service} from '@ember/service';
|
|
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
import Controller from '@ember/controller';
|
|
|
|
@classic
|
|
export default class ApplicationController extends Controller {
|
|
@service billing;
|
|
@service config;
|
|
@service dropdown;
|
|
@service feature;
|
|
@service router;
|
|
@service session;
|
|
@service settings;
|
|
@service ui;
|
|
|
|
@reads('config.hostSettings.billing.enabled')
|
|
showBilling;
|
|
|
|
@computed(
|
|
'router.currentRouteName',
|
|
'session.{isAuthenticated,user}',
|
|
'ui.isFullScreen'
|
|
)
|
|
get showNavMenu() {
|
|
let {router, session, ui} = this;
|
|
|
|
// if we're in fullscreen mode don't show the nav menu
|
|
if (ui.isFullScreen) {
|
|
return false;
|
|
}
|
|
|
|
// we need to defer showing the navigation menu until the session.user
|
|
// is populated so that gh-user-can-admin has the correct data
|
|
if (!session.isAuthenticated || !session.user) {
|
|
return false;
|
|
}
|
|
|
|
return (router.currentRouteName !== 'error404' || session.isAuthenticated)
|
|
&& !router.currentRouteName.match(/(signin|signup|setup|reset)/);
|
|
}
|
|
}
|