erik / derive

Generate personal heatmap from GPX/TCX/FIT/IGC data
https://erik.github.io/derive
MIT License
484 stars 62 forks source link

Inconsistency in counting loaded tracks/files #67

Open hajduakos opened 1 year ago

hajduakos commented 1 year ago

When dragging and dropping files, I observed the loading screen to say "240 loaded of 238". I think this inconsistency comes from the fact that the total is given by the number of files (numFiles): https://github.com/erik/derive/blob/ed9d902ad0a0fb1e69d35aaf16d7cb1e60e71129/src/ui.js#L130

but numLoaded is incremented for each track (and not for each file): https://github.com/erik/derive/blob/ed9d902ad0a0fb1e69d35aaf16d7cb1e60e71129/src/ui.js#L89-L96

So if there are files with multiple tracks, this inconsistency can occur that the number of loaded is more than the number of total.

Perhaps a quick fix would be to move modal.addSuccess(); out of the loop?

erik commented 1 year ago

Nice catch! Thanks for digging into the cause as well.