1
0
Fork 0

fix replaceWith calling style deprecation

Dieser Commit ist enthalten in:
merefield 2023-09-14 14:34:18 +01:00
Ursprung 6c0d7a671e
Commit 31f917ec80
2 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1,11 +1,14 @@
import { getCachedWizard } from "../models/custom-wizard";
import Route from "@ember/routing/route";
import { inject as service } from '@ember/service';
export default Route.extend({
router: service(),
beforeModel() {
const wizard = getCachedWizard();
if (wizard && wizard.permitted && !wizard.completed && wizard.start) {
this.replaceWith("customWizardStep", wizard.start);
this.router.replaceWith("customWizardStep", wizard.start);
}
},

Datei anzeigen

@ -3,14 +3,17 @@ import { getCachedWizard } from "../models/custom-wizard";
import Route from "@ember/routing/route";
import { scrollTop } from "discourse/mixins/scroll-top";
import { action } from "@ember/object";
import { inject as service } from '@ember/service';
export default Route.extend({
router: service(),
beforeModel() {
const wizard = getCachedWizard();
this.set("wizard", wizard);
if (!wizard || !wizard.permitted || wizard.completed) {
this.replaceWith("customWizard");
this.router.replaceWith("customWizard");
}
},