mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
fcb4e5a1a1
Co-authored-by: David Taylor <david@taylorhq.com>
18 lines
466 B
JavaScript
18 lines
466 B
JavaScript
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default DiscourseRoute.extend({
|
|
model(params) {
|
|
const allSteps = this.modelFor("wizard").steps;
|
|
const step = allSteps.findBy("id", params.step_id);
|
|
|
|
return step || allSteps[0];
|
|
},
|
|
|
|
setupController(controller, step) {
|
|
const wizard = this.modelFor("wizard");
|
|
this.controllerFor("wizard").set("currentStepId", step.id);
|
|
|
|
controller.setProperties({ step, wizard });
|
|
},
|
|
});
|