de-lodashify

This commit is contained in:
Henry Jameson 2026-08-04 16:36:27 +03:00
commit 2db420ac54
7 changed files with 44 additions and 56 deletions

View file

@ -1,5 +1,3 @@
import { uniq } from 'lodash'
import * as DateUtils from 'src/services/date_utils/date_utils.js'
const pollFallbackValues = {
@ -19,9 +17,9 @@ export const pollFormToMasto = (poll) => {
pollFallback(poll, 'expiryAmount'),
)
const options = uniq(
const options = [...new Set(
pollFallback(poll, 'options').filter((option) => option !== ''),
)
)]
if (options.length < 2) {
return { errorKey: 'polls.not_enough_options' }
}