start of routing reactivity

This commit is contained in:
vcoppe
2024-04-24 20:13:42 +02:00
parent 88c6681a78
commit 482dff54f4
8 changed files with 125 additions and 101 deletions

View File

@@ -5,7 +5,9 @@
import { GPXStatistics } from 'gpx';
import { fileCollection, selectedFiles, settings } from '$lib/stores';
import { selectedFiles, settings } from '$lib/stores';
import { get } from 'svelte/store';
import { MoveDownRight, MoveUpRight, Ruler, Timer, Zap } from 'lucide-svelte';
import { _ } from 'svelte-i18n';
@@ -14,10 +16,8 @@
$: {
gpxData = new GPXStatistics();
$fileCollection.files.forEach((file) => {
if ($selectedFiles.has(file)) {
gpxData.mergeWith(file.statistics);
}
$selectedFiles.forEach((file) => {
gpxData.mergeWith(get(file).statistics);
});
}
</script>