Skip to content

Commit

Permalink
LINT: make eslint & prettier happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ZogStriP committed Oct 31, 2024
1 parent 98ed704 commit 9e56643
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions assets/javascripts/initializers/discourse-perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@ function initialize(api) {
const result = this._super(force);

const perspectiveEnabled = this.siteSettings.perspective_enabled;
const perspectiveNotifyUser = this.siteSettings.perspective_notify_posting_min_toxicity_enable;
const perspectiveNotifyUser =
this.siteSettings.perspective_notify_posting_min_toxicity_enable;

if (perspectiveEnabled && perspectiveNotifyUser) {
const isPM = this.get("topic.isPrivateMessage");
const checkPM = this.siteSettings.perspective_check_private_message;

const isSecureCategory = this.get("model.category.read_restricted");
const checkSecureCategories = this.siteSettings.perspective_check_secured_categories;
const isSecureCategory = this.get("model.category.read_restricted");
const checkSecureCategories =
this.siteSettings.perspective_check_secured_categories;

const check = !isPM || checkPM || !isSecureCategory || checkSecureCategories;
const check =
!isPM || checkPM || !isSecureCategory || checkSecureCategories;

if (check) {
this.set("disableSubmit", true);
Expand All @@ -51,7 +54,11 @@ function initialize(api) {
},

perspectiveCheckToxicity(composer, force) {
const concat = ["title", "raw", "reply"].map((item) => composer.get(item)).filter(Boolean).join(" ").trim();
const concat = ["title", "raw", "reply"]
.map((item) => composer.get(item))
.filter(Boolean)
.join(" ")
.trim();

return ajax("/perspective/post_toxicity", {
type: "POST",
Expand Down

0 comments on commit 9e56643

Please sign in to comment.