From 31e2c63549a7c77b2776e99dfe2587ecee604f07 Mon Sep 17 00:00:00 2001
From: Jasper Vriends <4417659+jaspervriends@users.noreply.github.com>
Date: Sat, 27 Mar 2021 21:19:27 +0100
Subject: [PATCH] Linter
---
js/src/forum/components/BadgeModal.js | 9 ++---
js/src/forum/components/BadgesProfilePage.js | 18 +++++-----
js/src/forum/components/GiveBadgeModal.js | 37 +++++++++++---------
js/src/forum/components/UserBadgeList.js | 4 +--
4 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/js/src/forum/components/BadgeModal.js b/js/src/forum/components/BadgeModal.js
index 8f2d2dd..8ca180d 100644
--- a/js/src/forum/components/BadgeModal.js
+++ b/js/src/forum/components/BadgeModal.js
@@ -171,16 +171,13 @@ export default class BadgeModal extends Modal {
- {this.attrs.badge.category() && (
- this.attrs.badge.category().name()
- )}
+ {this.attrs.badge.category() && this.attrs.badge.category().name()}
{/* Uncategorized */}
- {!this.attrs.badge.category() && (
+ {!this.attrs.badge.category() &&
app.translator.trans(
"v17development-flarum-badges.forum.uncategorized"
- )
- )}
+ )}
{/*
- );
+ return ;
}
return UserBadgeList.component({
@@ -29,11 +27,13 @@ export default class BadgesProfilePage extends UserPage {
super.show(user);
this.user = user;
- app.store.find('users', user.id(), {
- include: 'userBadges,userBadges.badge,userBadges.badge.category'
- }).then(() => {
- this.loading = false;
- m.redraw();
- });
+ app.store
+ .find("users", user.id(), {
+ include: "userBadges,userBadges.badge,userBadges.badge.category",
+ })
+ .then(() => {
+ this.loading = false;
+ m.redraw();
+ });
}
}
diff --git a/js/src/forum/components/GiveBadgeModal.js b/js/src/forum/components/GiveBadgeModal.js
index de5cde8..7d1c81c 100644
--- a/js/src/forum/components/GiveBadgeModal.js
+++ b/js/src/forum/components/GiveBadgeModal.js
@@ -38,15 +38,15 @@ export default class GiveBadgeModal extends Modal {
this.loading = true;
app.store
- .find('badges', {
- include: 'category'
+ .find("badges", {
+ include: "category",
})
- .then(badges => {
- badges.forEach(badge => {
+ .then((badges) => {
+ badges.forEach((badge) => {
// Categorized
- if(badge.category()) {
+ if (badge.category()) {
const category = badge.category();
-
+
if (!this.categories[category.id()]) {
this.categories[category.id()] = {
category,
@@ -57,7 +57,7 @@ export default class GiveBadgeModal extends Modal {
}
}
// Uncategorized
- else{
+ else {
this.uncategorizedBadges.push(badge);
}
});
@@ -141,22 +141,25 @@ export default class GiveBadgeModal extends Modal {
{/* When no badge is selected, show all available badges */}
{!this.attrs.badge &&
- Object.values(this.categories).map(({ category, badges}) => (
+ Object.values(this.categories).map(({ category, badges }) => (
))}
-
- {!this.attrs.badge &&
- this.uncategorizedBadges.length >= 1 && (
-
- )}
+
+ {!this.attrs.badge && this.uncategorizedBadges.length >= 1 && (
+
+ )}
{/* When a badge is already assigned */}
{!!this.attrs.badge && (
diff --git a/js/src/forum/components/UserBadgeList.js b/js/src/forum/components/UserBadgeList.js
index 9134be4..603f121 100644
--- a/js/src/forum/components/UserBadgeList.js
+++ b/js/src/forum/components/UserBadgeList.js
@@ -10,7 +10,7 @@ export default class UserBadgeList extends Component {
if (!userBadge) return null;
// Categorized
- if(userBadge.badge().category()) {
+ if (userBadge.badge().category()) {
const category = userBadge.badge().category();
if (!categories[category.id()]) {
@@ -23,7 +23,7 @@ export default class UserBadgeList extends Component {
}
}
// Uncategorized
- else{
+ else {
uncategorized.push(userBadge);
}
});