FIX: preferences controller override following core change (#85)

This commit is contained in:
David Taylor 2025-03-26 22:57:27 +00:00 committed by GitHub
parent f472444ae9
commit 77467c1372
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
import { action } from "@ember/object";
import { isEmpty } from "@ember/utils"; import { isEmpty } from "@ember/utils";
import { withPluginApi } from "discourse/lib/plugin-api"; import { withPluginApi } from "discourse/lib/plugin-api";
import RawHtml from "discourse/widgets/raw-html"; import RawHtml from "discourse/widgets/raw-html";
@ -45,20 +46,21 @@ function attachSignature(api, siteSettings) {
} }
function addSetting(api) { function addSetting(api) {
api.modifyClass("controller:preferences/profile", { api.modifyClass(
pluginId: "discourse-signatures", "controller:preferences/profile",
(Superclass) =>
actions: { class extends Superclass {
save() { @action
this.set( save() {
"model.custom_fields.see_signatures", this.set(
this.get("model.see_signatures") "model.custom_fields.see_signatures",
); this.get("model.see_signatures")
this.get("saveAttrNames").push("custom_fields"); );
this._super(); this.get("saveAttrNames").push("custom_fields");
}, super.save();
}, }
}); }
);
} }
export default { export default {