Ghost/ghost/admin/app/controllers/application.js
Kevin Ansfield 9cfb024a5f Moved adjusted accent color properties to ui service
refs https://github.com/TryGhost/Team/issues/927

- we'll soon need access to adjusted accent colours outside of the application controller so they're now available on the `ui` service
2021-07-26 17:03:17 +01:00

36 lines
1.2 KiB
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({
billing: service(),
customViews: service(),
config: service(),
dropdown: service(),
feature: service(),
router: service(),
session: service(),
settings: service(),
ui: service(),
showBilling: computed.reads('config.hostSettings.billing.enabled'),
showNavMenu: computed('router.currentRouteName', 'session.{isAuthenticated,user}', 'ui.isFullScreen', function () {
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)/);
})
});