fixes preview thumbnail vanishing

This commit is contained in:
Christian Beutel
2025-04-11 16:40:09 +02:00
parent 7f1b5b5178
commit 95227624b8
2 changed files with 8 additions and 3 deletions

View File

@@ -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) throw new APIError(r.status, response.message, response.detail)
} }
model = await r.json();
return model; return model;
} }

View File

@@ -171,8 +171,7 @@
(p) => !p.startsWith("data:image/svg+xml;base64"), (p) => !p.startsWith("data:image/svg+xml;base64"),
); );
if (!form.photos?.length && if (!form.photos?.length && !photoFiles.length) {
!photoFiles.length) {
const canvas = document.querySelector( const canvas = document.querySelector(
"#map .maplibregl-canvas", "#map .maplibregl-canvas",
) as HTMLCanvasElement; ) as HTMLCanvasElement;
@@ -1084,7 +1083,11 @@
></Select> ></Select>
</div> </div>
<Toggle name="public" label={$formData.public ? $_("public") : $_("private")} icon={$formData.public ? "globe" : "lock"}></Toggle> <Toggle
name="public"
label={$formData.public ? $_("public") : $_("private")}
icon={$formData.public ? "globe" : "lock"}
></Toggle>
<hr class="border-separator" /> <hr class="border-separator" />
<h3 class="text-xl font-semibold"> <h3 class="text-xl font-semibold">
{$_("waypoints", { values: { n: 2 } })} {$_("waypoints", { values: { n: 2 } })}