mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
916c12546f
refs b4e750466d
- liquid-wormhole was throwing an error with the previous approach because it appeared to be trying to run it's destroy routines after the element had already been removed or hadn't been rendered yet
27 lines
744 B
JavaScript
27 lines
744 B
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class LaunchRoute extends AuthenticatedRoute {
|
|
@service session;
|
|
@service ui;
|
|
|
|
activate() {
|
|
// disable before rendering template to avoid issues with liquid-wormhole
|
|
// attempting to destroy elements mid-render if disabled via component hooks
|
|
this.ui.set('showTour', false);
|
|
}
|
|
|
|
deactivate() {
|
|
this.ui.set('showTour', true);
|
|
}
|
|
|
|
beforeModel() {
|
|
super.beforeModel(...arguments);
|
|
return this.session.user.then((user) => {
|
|
if (!user.isOwner) {
|
|
return this.transitionTo('home');
|
|
}
|
|
});
|
|
}
|
|
}
|