diff --git a/src/app/utils/vote.ts b/src/app/utils/vote.ts index bb935375f0..7ed042dcbe 100644 --- a/src/app/utils/vote.ts +++ b/src/app/utils/vote.ts @@ -13,5 +13,9 @@ const voteFilters: Record = { 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 + } + return (vote: ExtendedVote) => hasTextMatch(vote.validator?.media?.name, [fragment]) +}