mirror of
https://github.com/discourse/discourse.git
synced 2025-02-09 04:44:59 +00:00
Extracted from https://github.com/discourse/discourse/pull/23678 Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
18 lines
425 B
JavaScript
18 lines
425 B
JavaScript
import { inject as service } from "@ember/service";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class WizardStepRoute extends DiscourseRoute {
|
|
@service router;
|
|
|
|
model(params) {
|
|
const wizard = this.modelFor("wizard");
|
|
const step = wizard.findStep(params.step_id);
|
|
|
|
if (!step) {
|
|
this.router.transitionTo("wizard.step", wizard.start);
|
|
}
|
|
|
|
return { wizard, step };
|
|
}
|
|
}
|