0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 01:10:28 +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 {
name: "custom-wizard-edits",
initialize(container) {
const messageBus = container.lookup("service:message-bus");
const siteSettings = container.lookup("service:site-settings");
if (!siteSettings.custom_wizard_enabled) {
return;
}
messageBus.subscribe("/redirect_to_wizard", function (wizardId) {
const wizardUrl = window.location.origin + "/w/" + wizardId;
window.location.href = wizardUrl;
});
withPluginApi("0.8.36", (api) => {
api.onAppEvent("page:changed", (data) => {
const currentUser = container.lookup("service:current-user");