feat(stores): saving routes
This commit is contained in:
@ -16,9 +16,9 @@
|
||||
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";
|
||||
import * as Card from "$lib/components/ui/card";
|
||||
import SavedRoutes from "../main/SavedRoutes.svelte";
|
||||
</script>
|
||||
|
||||
<div
|
||||
@ -159,27 +159,8 @@
|
||||
</Card.Root>
|
||||
{/if}
|
||||
|
||||
<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, _index (save.name)}
|
||||
<Button
|
||||
variant="secondary"
|
||||
onclick={() => {
|
||||
view.switch("trip", { route: JSON.parse(save.data) });
|
||||
}}>{save.name}</Button
|
||||
>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/await}
|
||||
<RequiresCapability capability="stores">
|
||||
<SavedRoutes />
|
||||
</RequiresCapability>
|
||||
|
||||
<RequiresCapability capability="post">
|
||||
|
||||
Reference in New Issue
Block a user