discourse/app/assets/javascripts/wizard/controllers/step.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
686 B
JavaScript
Raw Normal View History

import getUrl from "discourse-common/lib/get-url";
import Controller from "@ember/controller";
export default Controller.extend({
2016-08-25 13:14:56 -04:00
wizard: null,
step: null,
2016-08-25 13:14:56 -04:00
actions: {
2016-09-07 18:04:01 -04:00
goNext(response) {
const next = this.get("step.next");
if (response && response.refresh_required) {
if (this.get("step.id") === "locale") {
document.location = getUrl(`/wizard/steps/${next}`);
return;
} else {
this.send("refresh");
}
2016-09-07 18:04:01 -04:00
}
if (response && response.success) {
this.transitionToRoute("step", next);
}
2016-08-25 13:14:56 -04:00
},
goBack() {
this.transitionToRoute("step", this.get("step.previous"));
},
},
});