mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 05:43:39 +08:00
28 lines
686 B
JavaScript
28 lines
686 B
JavaScript
import getUrl from "discourse-common/lib/get-url";
|
|
import Controller from "@ember/controller";
|
|
|
|
export default Controller.extend({
|
|
wizard: null,
|
|
step: null,
|
|
|
|
actions: {
|
|
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");
|
|
}
|
|
}
|
|
if (response && response.success) {
|
|
this.transitionToRoute("step", next);
|
|
}
|
|
},
|
|
goBack() {
|
|
this.transitionToRoute("step", this.get("step.previous"));
|
|
},
|
|
},
|
|
});
|