diff --git a/components/tab-options/commodities.js b/components/tab-options/commodities.js index 2ee4f1c..7f23386 100644 --- a/components/tab-options/commodities.js +++ b/components/tab-options/commodities.js @@ -35,15 +35,15 @@ export default ({ disabled = false }) => { }, [lastUpdatedFilter, fleetCarrierFilter, minVolumeFilter, locationFilter, distanceFilter]) useEffect(() => { - if (router.query?.maxDaysAgo && router.query.maxDaysAgo !== lastUpdatedFilter) { + if (router.query?.maxDaysAgo && parseInt(router.query.maxDaysAgo) !== parseInt(lastUpdatedFilter)) { setLastUpdatedFilter(router.query.maxDaysAgo) window.localStorage.setItem('lastUpdatedFilter', router.query.maxDaysAgo) } - if (router.query?.fleetCarriers && router.query.fleetCarriers !== fleetCarrierFilter) { + if (router.query?.fleetCarriers && router.query.fleetCarriers !== parseInt(fleetCarrierFilter)) { setFleetCarrierFilter(router.query.fleetCarriers) window.localStorage.setItem('fleetCarrierFilter', router.query.fleetCarriers) } - if (router.query?.minVolume && router.query.minVolume !== minVolumeFilter) { + if (router.query?.minVolume && parseInt(router.query.minVolume) !== parseInt(minVolumeFilter)) { setMinVolumeFilter(router.query.minVolume) window.localStorage.setItem('minVolumeFilter', router.query.minVolume) } @@ -52,7 +52,7 @@ export default ({ disabled = false }) => { window.localStorage.setItem('locationFilter', router.query.location.trim()) document.getElementById('location').value = router.query.location.trim() } - if (router.query?.maxDistance && router.query.maxDaysAgo !== distanceFilter) { + if (router.query?.maxDistance && parseInt(router.query.maxDaysAgo) !== parseInt(distanceFilter)) { setDistanceFilter(router.query.maxDistance) window.localStorage.setItem('distanceFilter', router.query.maxDistance) } @@ -60,7 +60,10 @@ export default ({ disabled = false }) => { return (