Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 01:10:28 +01:00
fix replaceWith calling style deprecation
Dieser Commit ist enthalten in:
Ursprung
6c0d7a671e
Commit
31f917ec80
2 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Laden …
In neuem Issue referenzieren