Skip to content

Commit

Permalink
fix linting; cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeaty committed Jul 13, 2023
1 parent ee7ba82 commit 0930c34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const UserBanPopoverContainer: FunctionComponent<Props> = ({
onDismiss();
} else {
// this will trigger the spam ban confirmation view to show for this comment
setSpamBanned({ commentID: comment.id, spamBanned: true });
void setSpamBanned({ commentID: comment.id, spamBanned: true });
}
}, [
user.id,
Expand Down
12 changes: 7 additions & 5 deletions src/core/server/services/users/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1412,17 +1412,19 @@ export async function ban(
alreadyBanned = true;
}

// check if user is already banned on all of the siteIDs
// check if user is already banned on all of the siteIDs provided
if (
targetUser.status.ban.siteIDs &&
targetUser.status.ban.siteIDs.length > 0
targetUser.status.ban.siteIDs.length > 0 &&
siteIDs &&
siteIDs.length > 0
) {
const siteIDsAlreadyBanned = targetUser.status.ban.siteIDs?.filter(
const siteIDsAlreadyBanned = targetUser.status.ban.siteIDs.filter(
(siteID) => {
return siteIDs?.includes(siteID);
return siteIDs.includes(siteID);
}
);
if (siteIDsAlreadyBanned.length === siteIDs?.length) {
if (siteIDsAlreadyBanned.length === siteIDs.length) {
alreadyBanned = true;
}
}
Expand Down

0 comments on commit 0930c34

Please sign in to comment.