Skip to content

Commit

Permalink
fix: mods can vote to delete no matter what
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jul 6, 2024
1 parent 7b35c3b commit 34744a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/UserscriptTools/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,10 @@ export default class Post {

const userRep = StackExchange.options.user.rep;

// >20k rep users can vote to delete answers with score < 0
return (
return StackExchange.options.user.isModerator || (

Check failure on line 412 in src/UserscriptTools/Post.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected mix of '||' and '&&'. Use parentheses to clarify the intended order of operations
// if the delete button is visible, then the user can vote to delete
Boolean(deleteButton)
// >20k rep users can vote to delete answers with score < 0
|| (userRep >= 20_000 && (popover ? this.score <= 0 : this.score < 0))
) // can delete if post isn't already deleted
&& !this.deleted;

Check failure on line 418 in src/UserscriptTools/Post.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected mix of '||' and '&&'. Use parentheses to clarify the intended order of operations
Expand Down

0 comments on commit 34744a2

Please sign in to comment.