2023-05-16 09:33:17 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
|
|
|
export default class SettingsXRoute extends AuthenticatedRoute {
|
|
|
|
@service session;
|
|
|
|
@service ui;
|
2023-06-20 05:58:44 +03:00
|
|
|
@service modals;
|
2023-05-16 09:33:17 +03:00
|
|
|
|
|
|
|
beforeModel() {
|
|
|
|
super.beforeModel(...arguments);
|
|
|
|
|
|
|
|
const user = this.session.user;
|
|
|
|
|
|
|
|
if (!user.isAdmin) {
|
|
|
|
return this.transitionTo('settings.staff.user', user);
|
|
|
|
}
|
2023-05-16 09:56:47 +03:00
|
|
|
|
|
|
|
if (!this.config.adminX?.url) {
|
|
|
|
return this.router.transitionTo('settings');
|
|
|
|
}
|
2023-05-16 09:33:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
activate() {
|
|
|
|
super.activate(...arguments);
|
|
|
|
this.ui.set('isFullScreen', true);
|
|
|
|
}
|
|
|
|
|
|
|
|
deactivate() {
|
|
|
|
super.deactivate(...arguments);
|
|
|
|
this.ui.set('isFullScreen', false);
|
|
|
|
}
|
|
|
|
}
|