From 39d98c8ae39c43e19352e95323c2cc27ef819fe3 Mon Sep 17 00:00:00 2001 From: derGraph Date: Tue, 20 Aug 2024 12:58:41 +0200 Subject: [PATCH 1/3] Revert "remove unused Leaflet.css" This reverts commit ec0bf7ed05ef5c08623aa8535a16210f869d275e. --- src/lib/Leaflet.css | 0 src/lib/Leaflet.svelte | 1 + 2 files changed, 1 insertion(+) create mode 100755 src/lib/Leaflet.css diff --git a/src/lib/Leaflet.css b/src/lib/Leaflet.css new file mode 100755 index 0000000..e69de29 diff --git a/src/lib/Leaflet.svelte b/src/lib/Leaflet.svelte index 060465d..b3926e7 100755 --- a/src/lib/Leaflet.svelte +++ b/src/lib/Leaflet.svelte @@ -1,5 +1,6 @@ From 0e481cb2264cf1f73e0e729075a0902676fcd818 Mon Sep 17 00:00:00 2001 From: derGraph Date: Tue, 20 Aug 2024 13:09:10 +0200 Subject: [PATCH 3/3] show active track on homepage --- src/routes/+page.svelte | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8479490..17c6bb9 100755 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,10 +2,30 @@ // @ts-ignore import type { LatLngExpression } from 'leaflet'; import Leaflet from '$lib/Leaflet.svelte'; + import { onMount } from 'svelte'; + import errorStore from '$lib/errorStore.js'; + + export let data; + let tracks: null = null; const initialView: LatLngExpression = [43.95, 14.79]; + + async function getTrip(tripId: String) { + let response = await fetch('/api/Datapoints?tripId='+tripId); + if(!response.ok){ + $errorStore = response; + } + tracks = await response.json(); + } + + onMount(()=>{ + if(data.user){ + getTrip(data.user?.activeTripId); + } + }); +
- +