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

Add back message bus subscription

Dieser Commit ist enthalten in:
Robert Barrow 2023-07-11 19:49:19 +01:00
Ursprung bf2dcdba86
Commit 6a9f93bccb

Datei anzeigen

@ -7,12 +7,18 @@ import { dasherize } from "@ember/string";
export default { export default {
name: "custom-wizard-edits", name: "custom-wizard-edits",
initialize(container) { initialize(container) {
const messageBus = container.lookup("service:message-bus");
const siteSettings = container.lookup("service:site-settings"); const siteSettings = container.lookup("service:site-settings");
if (!siteSettings.custom_wizard_enabled) { if (!siteSettings.custom_wizard_enabled) {
return; return;
} }
messageBus.subscribe("/redirect_to_wizard", function (wizardId) {
const wizardUrl = window.location.origin + "/w/" + wizardId;
window.location.href = wizardUrl;
});
withPluginApi("0.8.36", (api) => { withPluginApi("0.8.36", (api) => {
api.onAppEvent("page:changed", (data) => { api.onAppEvent("page:changed", (data) => {
const currentUser = container.lookup("service:current-user"); const currentUser = container.lookup("service:current-user");