We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31ad4c1 commit c0b1f03Copy full SHA for c0b1f03
frontend/src/components/CarFilter.tsx
@@ -92,7 +92,7 @@ const CarFilter = ({
92
const sameLocation = useWatch({ control, name: 'sameLocation' })
93
94
useEffect(() => {
95
- if (filterFrom) {
+ if (settings && filterFrom) {
96
let __minDate = new Date(filterFrom)
97
__minDate = addHours(__minDate, settings!.minRentalHours)
98
setMinDate(__minDate)
@@ -190,7 +190,7 @@ const CarFilter = ({
190
validateTimes()
191
}, [from, to]) // eslint-disable-line react-hooks/exhaustive-deps
192
193
- // Guard against using `minDate` before it's ready
+ // Guard against using `minDate` before it's ready
194
if (!settings || !minDate || !fromMinDate || !minTime || !maxTime) {
195
return null
196
}
0 commit comments