Ghost/ghost/admin/app/routes/launch.js
Kevin Ansfield 916c12546f Fixed liquid-wormhole error when directly accessing /launch
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
2021-02-09 12:07:44 +00:00

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');
}
});
}
}