fixed min-max problem

This commit is contained in:
Fedor Katurov 2020-02-11 11:32:22 +07:00
parent 1d45e65434
commit a19555b429

View file

@ -15,7 +15,7 @@ const MapListDialogHead: FC<Props> = memo(
({ min, max, ready, distance, search, onSearchChange, onDistanceChange }) => { ({ min, max, ready, distance, search, onSearchChange, onDistanceChange }) => {
const marks = useMemo( const marks = useMemo(
() => () =>
[...new Array(Math.floor((max - min) / 25) + 1)].reduce( [...new Array(Math.floor((Math.max(min, max) - Math.max(min, max)) / 25) + 1)].reduce(
(obj, el, i) => ({ (obj, el, i) => ({
...obj, ...obj,
[min + i * 25]: min + i * 25 < 200 ? ` ${min + i * 25}` : ` ${min + i * 25}+`, [min + i * 25]: min + i * 25 < 200 ? ` ${min + i * 25}` : ` ${min + i * 25}+`,