fix states order in filters in space app (#850)

This commit is contained in:
rahulramesha
2024-08-16 18:19:13 +05:30
committed by GitHub
parent 3e4fa21ee2
commit 68cf9e7732

View File

@@ -20,7 +20,7 @@ type Props = {
export const FilterState: React.FC<Props> = observer((props) => {
const { appliedFilters, handleUpdate, searchQuery, allowedValues } = props;
//store
const { getStateById, states: storeStates } = useStates();
const { sortedStates: storeStates } = useStates();
const [itemsToRender, setItemsToRender] = useState(5);
const [previewEnabled, setPreviewEnabled] = useState(true);
@@ -29,7 +29,7 @@ export const FilterState: React.FC<Props> = observer((props) => {
const states =
allowedValues && allowedValues.length > 0
? allowedValues.map((stateId: string) => getStateById(stateId))
? storeStates?.filter((state) => allowedValues.includes(state.id))
: storeStates;
const sortedOptions = useMemo(() => {