Skip to content

Commit

Permalink
Make voter name filter easier to read
Browse files Browse the repository at this point in the history
Co-authored-by: lubej <[email protected]>
  • Loading branch information
csillag and lubej authored May 16, 2024
1 parent d0d48c6 commit 953f2ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/utils/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ const voteFilters: Record<VoteType, VoteFilter> = {

export const getFilterForVoteType = (voteType: VoteType): VoteFilter => voteFilters[voteType]

export const getFilterForVoterNameFragment = (fragment: string | undefined) =>
fragment ? (vote: ExtendedVote) => hasTextMatch(vote.validator?.media?.name, [fragment]) : () => true
export const getFilterForVoterNameFragment = (fragment: string | undefined) => {
if(!fragment) { return () => true }

Check warning on line 17 in src/app/utils/vote.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `·if(!fragment)·{·return·()·=>·true` with `if·(!fragment)·{⏎····return·()·=>·true⏎·`
return (vote: ExtendedVote) => hasTextMatch(vote.validator?.media?.name, [fragment])

Check warning on line 18 in src/app/utils/vote.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `·`
}

Check warning on line 19 in src/app/utils/vote.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `·`

0 comments on commit 953f2ce

Please sign in to comment.