2021-01-21 12:20:06 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
2021-02-04 20:36:29 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2021-01-21 12:20:06 +03:00
|
|
|
|
2021-02-04 20:36:29 +03:00
|
|
|
export default class LaunchRoute extends AuthenticatedRoute {
|
|
|
|
@service session;
|
2021-02-09 15:07:44 +03:00
|
|
|
@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);
|
|
|
|
}
|
2021-02-04 20:36:29 +03:00
|
|
|
|
|
|
|
beforeModel() {
|
2021-02-04 20:45:16 +03:00
|
|
|
super.beforeModel(...arguments);
|
2021-02-04 20:36:29 +03:00
|
|
|
return this.session.user.then((user) => {
|
|
|
|
if (!user.isOwner) {
|
|
|
|
return this.transitionTo('home');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|