0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

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