Skip to content

WIP: move hasValidData to workoutState and avoid refetching datapoints#510

Draft
morteako wants to merge 4 commits intomainfrom
hasValidData-gb
Draft

WIP: move hasValidData to workoutState and avoid refetching datapoints#510
morteako wants to merge 4 commits intomainfrom
hasValidData-gb

Conversation

@morteako
Copy link
Collaborator

@morteako morteako commented Mar 1, 2025

Seems to work
Haven't actually benchmarked (not sure how tbh 👀)
But my guess is that that query can be a bit intense, and seemed like it was fetched 4 times per second? (at the same time+-)
for some reason.

Here the components that need it, fetch the tracked data only when needed (upload and download, when clicked).
Will probably also reduce the amount of rerenders for these components.

BUT!

This doesnt work for the Map :S
I am not sure, but could one maybe instead change to calculate a % of the route done, and then create x-y points based on that?

const start = React.useCallback(async () => {
if (trackedData.length > 0) {
if (!hasValidData) {
// was this wrong before?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant