mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
9dd2489000
refs https://github.com/TryGhost/Product/issues/3433 - Removed Ember dirty state from AdminX to prevent extra popups - Fixed incorrect navigation popup new item errors
33 lines
784 B
JavaScript
33 lines
784 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class SettingsXRoute extends AuthenticatedRoute {
|
|
@service session;
|
|
@service ui;
|
|
@service modals;
|
|
|
|
beforeModel() {
|
|
super.beforeModel(...arguments);
|
|
|
|
const user = this.session.user;
|
|
|
|
if (!user.isAdmin) {
|
|
return this.transitionTo('settings.staff.user', user);
|
|
}
|
|
|
|
if (!this.config.adminX?.url) {
|
|
return this.router.transitionTo('settings');
|
|
}
|
|
}
|
|
|
|
activate() {
|
|
super.activate(...arguments);
|
|
this.ui.set('isFullScreen', true);
|
|
}
|
|
|
|
deactivate() {
|
|
super.deactivate(...arguments);
|
|
this.ui.set('isFullScreen', false);
|
|
}
|
|
}
|