mirror of
https://github.com/discourse/discourse-signatures.git
synced 2025-12-12 18:03:31 +00:00
FIX: preferences controller override following core change (#85)
This commit is contained in:
parent
f472444ae9
commit
77467c1372
@ -1,3 +1,4 @@
|
||||
import { action } from "@ember/object";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import RawHtml from "discourse/widgets/raw-html";
|
||||
@ -45,20 +46,21 @@ function attachSignature(api, siteSettings) {
|
||||
}
|
||||
|
||||
function addSetting(api) {
|
||||
api.modifyClass("controller:preferences/profile", {
|
||||
pluginId: "discourse-signatures",
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
this.set(
|
||||
"model.custom_fields.see_signatures",
|
||||
this.get("model.see_signatures")
|
||||
);
|
||||
this.get("saveAttrNames").push("custom_fields");
|
||||
this._super();
|
||||
},
|
||||
},
|
||||
});
|
||||
api.modifyClass(
|
||||
"controller:preferences/profile",
|
||||
(Superclass) =>
|
||||
class extends Superclass {
|
||||
@action
|
||||
save() {
|
||||
this.set(
|
||||
"model.custom_fields.see_signatures",
|
||||
this.get("model.see_signatures")
|
||||
);
|
||||
this.get("saveAttrNames").push("custom_fields");
|
||||
super.save();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user