Skip to content

Commit

Permalink
🐛 Fix assistance car km [NGC-1064] (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlaa authored Sep 9, 2024
1 parent 907d97a commit d0a8eca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/specialQuestions/voiture/JourneysInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@ export default function JourneysInput({ question, setTempValue }: Props) {

const prevTotal = useRef(total)

useEffect(() => {
setNumPassengers(averagePassengers)
}, [averagePassengers, setNumPassengers])

useEffect(() => {
if (prevTotal.current !== total) {
if (setTempValue) setTempValue(total)
setValue(total, { foldedStep: question })
setNumPassengers(averagePassengers)
}
prevTotal.current = total
}, [
Expand Down

0 comments on commit d0a8eca

Please sign in to comment.