feat(saved-routes): require server capability
Some checks failed
TrafficCue CI / check (push) Failing after 34s
TrafficCue CI / build (push) Failing after 34s

This commit is contained in:
Cfp
2025-08-19 12:48:44 +02:00
parent 64ed0c8204
commit 2f6f17ca52
3 changed files with 34 additions and 29 deletions

View File

@ -98,21 +98,23 @@
<VehicleSelector />
{#await getSaved() then saved}
{#if saved.length != 0}
<div>
<h2 style="margin: 5px; margin-left: 0; font-size: 1.2em;">Saved Routes</h2>
<RequiresCapability capability="saved-routes">
{#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 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>
</div>
{/if}
{/await}
{/if}
{/await}
</RequiresCapability>
<RequiresCapability capability="post">
<div>