Ghost/ghost/admin/app/routes/setup/done.js
Kevin Ansfield 5cb85ff58f
Replaced setup/done screen with onboarding checklist (#19952)
part of https://linear.app/tryghost/issue/IPC-81/remove-setupdone-screen-from-signup-flow

- when the `onboardingChecklist` flag is enabled the `setup/done` screen shown after install or signup will initiate the onboarding checklist and redirect straight to the dashboard effectively replacing the previous onboarding flow
2024-03-28 16:10:59 +00:00

33 lines
839 B
JavaScript

import Route from '@ember/routing/route';
import {inject as service} from '@ember/service';
export default class SetupFinishingTouchesRoute extends Route {
@service feature;
@service onboarding;
@service router;
@service session;
@service settings;
@service themeManagement;
beforeModel() {
if (!this.session.user.isOwnerOnly) {
return;
}
if (this.feature.onboardingChecklist) {
this.onboarding.startChecklist();
return this.router.transitionTo('dashboard');
}
}
model() {
this.themeManagement.setPreviewType('homepage');
this.themeManagement.updatePreviewHtmlTask.perform();
}
deactivate() {
// rollback any unsaved setting changes when leaving
this.settings.rollbackAttributes();
}
}