Skip to content

Commit

Permalink
DEV: Update modifyClass calls to native class syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaylorhq committed Dec 2, 2024
1 parent 872dddd commit 24841e5
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions assets/javascripts/discourse/initializers/init-code-review.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,27 @@ function initialize(api) {
//
// note there are slightly cleaner ways of doing this but we would need
// to amend core for the plugin which is not feeling right
api.modifyClass("controller:preferences/account", {
pluginId: PLUGIN_ID,

canUpdateAssociatedAccounts: computed("authProviders", function () {
return findAll().length > 0;
}),
});

api.modifyClass("controller:preferences/notifications", {
pluginId: PLUGIN_ID,

init() {
this._super(...arguments);
this.saveAttrNames.push("custom_fields");
},
});
api.modifyClass(
"controller:preferences/account",
(Superclass) =>
class extends Superclass {
@computed("authProviders")
get canUpdateAssociatedAccounts() {
return findAll().length > 0;
}
}
);

api.modifyClass(
"controller:preferences/notifications",
(Superclass) =>
class extends Superclass {
init() {
super.init(...arguments);
this.saveAttrNames.push("custom_fields");
}
}
);

function allowSkip(currentUser, topic, siteSettings) {
return allowApprove(currentUser, topic, siteSettings);
Expand Down

0 comments on commit 24841e5

Please sign in to comment.