mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
41bfcf2f76
useCallback captured tripStore at creation time (dep: [routeCalcEnabled]). If assignments were empty on first render (trip still loading), the callback would permanently see empty assignments and call setRoute(null) whenever invoked — e.g. when clicking a place triggers onSelectDay → updateRouteForDay. Fix: store tripStore in a ref updated on every render so the callback always reads the latest assignments without needing to be recreated.