Fix elevation profile not updating when route changes#372
Fix elevation profile not updating when route changes#372antburnett wants to merge 1 commit intovalhalla:masterfrom
Conversation
nilsnolde
left a comment
There was a problem hiding this comment.
Most of these changes have nothing to do with the PR (I think), and I'm not thrilled of merging them upstream unless there's good reasons (fixing some bug, adding some functionality). You can create your own docker image downstream.
There was a problem hiding this comment.
Oops! I really don't like the checked in .env. Should be a .env.template..
nginx.conf
Outdated
There was a problem hiding this comment.
Yes - there was overreach going on with the PR.
| useEffect(() => { | ||
| getHeightData(); | ||
| }, [getHeightData]); | ||
|
|
There was a problem hiding this comment.
in the end this is the only relevant change. can you revert everything else pls?
The height graph data was only fetched when the drawer was expanded/collapsed. Added a useEffect to automatically fetch height data whenever direction results change.
87368ec to
05718f8
Compare
|
Preview is ready! 🚀 You can view it here: https://valhalla-app-tests.gis-ops.com/372 |
|
functionality works fine, but tests are failing. |
|
ok then.. |
|
I’ll resubmit as a new PR when I understand React better. Or you can take the couple of lines and apply it directly. Thanks Nils! |
|
Ah ok, makes sense, no worries! I'll take the patch and apply it and bcs I don't have any interest in React I'll use AI to fix the tests;) Thanks for the fix, been bothering me a few times already! |
Summary
onExpanduseEffectthat automatically fetches height data wheneverdirectionResultschangesJSON.stringifycomparison prevents duplicate/heightAPI callsTest plan
/heightAPI calls when route hasn't changed