mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 16:52:31 +00:00
reactive modifications
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import { GPXStatistics } from 'gpx';
|
||||
|
||||
import { selectedFiles, settings } from '$lib/stores';
|
||||
import { getFileStore, selectedFiles, settings } from '$lib/stores';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
import { MoveDownRight, MoveUpRight, Ruler, Timer, Zap } from 'lucide-svelte';
|
||||
@@ -14,12 +14,16 @@
|
||||
|
||||
let gpxData: GPXStatistics = new GPXStatistics();
|
||||
|
||||
$: {
|
||||
function updateGPXData() {
|
||||
gpxData = new GPXStatistics();
|
||||
$selectedFiles.forEach((file) => {
|
||||
gpxData.mergeWith(get(file).statistics);
|
||||
gpxData.mergeWith(file.statistics);
|
||||
});
|
||||
}
|
||||
|
||||
$: if ($selectedFiles) {
|
||||
updateGPXData();
|
||||
}
|
||||
</script>
|
||||
|
||||
<Card.Root class="h-full overflow-hidden border-none min-w-48 pl-4">
|
||||
|
Reference in New Issue
Block a user