Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-15 22:32:54 +01:00
cf50a7deb3
* Apply prettier * applied prettier for similar-topics-validator Co-authored-by: Faizaan Gagan <fzngagan@gmail.com>
19 Zeilen
552 B
JavaScript
19 Zeilen
552 B
JavaScript
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
import DiscourseURL from "discourse/lib/url";
|
|
|
|
export default {
|
|
name: "custom-wizard-edits",
|
|
initialize(container) {
|
|
const siteSettings = container.lookup("site-settings:main");
|
|
|
|
if (!siteSettings.custom_wizard_enabled) return;
|
|
|
|
const existing = DiscourseURL.routeTo;
|
|
DiscourseURL.routeTo = function (path, opts) {
|
|
if (path && path.indexOf("/w/") > -1) {
|
|
return (window.location = path);
|
|
}
|
|
return existing.apply(this, [path, opts]);
|
|
};
|
|
},
|
|
};
|