diff --git a/src/components/location-search.tsx b/src/components/location-search.tsx index 9867a52fb..48b8c4b8a 100644 --- a/src/components/location-search.tsx +++ b/src/components/location-search.tsx @@ -2,7 +2,6 @@ import backspaceIcon from '@tabler/icons/outline/backspace.svg'; import searchIcon from '@tabler/icons/outline/search.svg'; import clsx from 'clsx'; import { throttle } from 'es-toolkit'; -import { OrderedSet as ImmutableOrderedSet } from 'immutable'; import { useCallback, useEffect, useRef, useState } from 'react'; import { defineMessages, useIntl } from 'react-intl'; @@ -26,7 +25,7 @@ interface ILocationSearch { const LocationSearch: React.FC = ({ onSelected }) => { const intl = useIntl(); const dispatch = useAppDispatch(); - const [locationIds, setLocationIds] = useState(ImmutableOrderedSet()); + const [locationIds, setLocationIds] = useState(new Set()); const controller = useRef(new AbortController()); const [value, setValue] = useState(''); @@ -67,14 +66,14 @@ const LocationSearch: React.FC = ({ onSelected }) => { }; const clearResults = () => { - setLocationIds(ImmutableOrderedSet()); + setLocationIds(new Set()); }; const handleLocationSearch = useCallback(throttle(q => { dispatch(locationSearch(q, controller.current.signal)) .then((locations: { origin_id: string }[]) => { const locationIds = locations.map(location => location.origin_id); - setLocationIds(ImmutableOrderedSet(locationIds)); + setLocationIds(new Set(locationIds)); }) .catch(noOp); @@ -93,7 +92,7 @@ const LocationSearch: React.FC = ({ onSelected }) => { placeholder={intl.formatMessage(messages.placeholder)} value={value} onChange={handleChange} - suggestions={locationIds.toList()} + suggestions={Array.from(locationIds)} onSuggestionsFetchRequested={noOp} onSuggestionsClearRequested={noOp} onSuggestionSelected={handleSelected} diff --git a/src/features/compose/components/polls/poll-form.tsx b/src/features/compose/components/polls/poll-form.tsx index 98313325e..666ec4d9b 100644 --- a/src/features/compose/components/polls/poll-form.tsx +++ b/src/features/compose/components/polls/poll-form.tsx @@ -156,7 +156,7 @@ const PollForm: React.FC = ({ composeId }) => { onChange={onChangeOption} onRemove={onRemoveOption} maxChars={maxOptionChars} - numOptions={options.size} + numOptions={options.length} onRemovePoll={onRemovePoll} /> ))} @@ -164,7 +164,7 @@ const PollForm: React.FC = ({ composeId }) => {
- {options.size < maxOptions && ( + {options.length < maxOptions && (