feat: initial support for saving routes
Some checks failed
TrafficCue CI / check (push) Failing after 32s
TrafficCue CI / build (push) Failing after 32s

This commit is contained in:
Cfp
2025-08-19 12:19:08 +02:00
parent babfb526de
commit 64ed0c8204
4 changed files with 86 additions and 11 deletions

View File

@ -9,6 +9,8 @@
import RequiresCapability from "../RequiresCapability.svelte";
import { saved } from "$lib/saved.svelte";
import { m } from "$lang/messages";
import { getSaved } from "$lib/services/lnv";
import { view } from "../view.svelte";
</script>
<div
@ -96,6 +98,22 @@
<VehicleSelector />
{#await getSaved() then saved}
{#if saved.length != 0}
<div>
<h2 style="margin: 5px; margin-left: 0; font-size: 1.2em;">Saved Routes</h2>
<div style="display: flex; flex-direction: column; gap: 10px;">
{#each saved as save}
<Button variant="secondary" onclick={() => {
view.switch("trip", { route: JSON.parse(save.data) })
}}>{save.name}</Button>
{/each}
</div>
</div>
{/if}
{/await}
<RequiresCapability capability="post">
<div>
<h2>In your area</h2>