From 95227624b8f56d96375d202bab096c5b0d45ca13 Mon Sep 17 00:00:00 2001 From: Christian Beutel <> Date: Fri, 11 Apr 2025 16:40:09 +0200 Subject: [PATCH] fixes preview thumbnail vanishing --- web/src/lib/stores/trail_store.ts | 2 ++ web/src/routes/trail/edit/[id]/+page.svelte | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/web/src/lib/stores/trail_store.ts b/web/src/lib/stores/trail_store.ts index 36f744cf..07712713 100644 --- a/web/src/lib/stores/trail_store.ts +++ b/web/src/lib/stores/trail_store.ts @@ -228,6 +228,8 @@ export async function trails_create(trail: Trail, photos: File[], gpx: File | Bl throw new APIError(r.status, response.message, response.detail) } + model = await r.json(); + return model; } diff --git a/web/src/routes/trail/edit/[id]/+page.svelte b/web/src/routes/trail/edit/[id]/+page.svelte index aba491c5..180c278a 100644 --- a/web/src/routes/trail/edit/[id]/+page.svelte +++ b/web/src/routes/trail/edit/[id]/+page.svelte @@ -171,8 +171,7 @@ (p) => !p.startsWith("data:image/svg+xml;base64"), ); - if (!form.photos?.length && - !photoFiles.length) { + if (!form.photos?.length && !photoFiles.length) { const canvas = document.querySelector( "#map .maplibregl-canvas", ) as HTMLCanvasElement; @@ -1084,7 +1083,11 @@ > - +

{$_("waypoints", { values: { n: 2 } })}