2024-04-02 19:43:44 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
2022-02-04 20:06:40 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
2024-04-02 19:43:44 +03:00
|
|
|
export default class SetupFinishingTouchesRoute extends AuthenticatedRoute {
|
2024-03-28 19:10:59 +03:00
|
|
|
@service feature;
|
|
|
|
@service onboarding;
|
|
|
|
@service router;
|
|
|
|
@service session;
|
2022-02-04 20:06:40 +03:00
|
|
|
@service settings;
|
|
|
|
@service themeManagement;
|
|
|
|
|
2024-03-28 19:10:59 +03:00
|
|
|
beforeModel() {
|
2024-04-02 19:43:44 +03:00
|
|
|
super.beforeModel(...arguments);
|
|
|
|
|
2024-03-28 19:10:59 +03:00
|
|
|
if (!this.session.user.isOwnerOnly) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.feature.onboardingChecklist) {
|
|
|
|
this.onboarding.startChecklist();
|
|
|
|
return this.router.transitionTo('dashboard');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-04 20:06:40 +03:00
|
|
|
model() {
|
|
|
|
this.themeManagement.setPreviewType('homepage');
|
|
|
|
this.themeManagement.updatePreviewHtmlTask.perform();
|
|
|
|
}
|
|
|
|
|
|
|
|
deactivate() {
|
|
|
|
// rollback any unsaved setting changes when leaving
|
|
|
|
this.settings.rollbackAttributes();
|
|
|
|
}
|
|
|
|
}
|