style: run prettier
All checks were successful
TrafficCue CI / check (push) Successful in 1m32s
TrafficCue CI / build (push) Successful in 9m41s
TrafficCue CI / build-android (push) Successful in 30m6s

This commit is contained in:
2025-09-29 19:00:25 +02:00
parent caf29ce60f
commit 1215c2ffb8
5 changed files with 32 additions and 22 deletions

View File

@ -31,5 +31,5 @@
onMount(async () => {
await login();
location.href = "/";
})
});
</script>

View File

@ -8,9 +8,7 @@
{#if saved.current.length != 0}
<div>
<h2 style="margin: 5px; margin-left: 0; font-size: 1.2em;">
Saved Routes
</h2>
<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.current as save, _index (save.name)}
@ -18,7 +16,8 @@
variant="secondary"
onclick={() => {
view.switch("trip", { route: save.data });
}}>{save.data.name}</Button>
}}>{save.data.name}</Button
>
{/each}
</div>
</div>

View File

@ -23,7 +23,7 @@
removeAllRoutes();
drawRoute(route);
if(route) {
if (route) {
isSaved = await hasStore({
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
type: "route",
@ -59,22 +59,28 @@
variant="secondary"
onclick={async () => {
if (isSaved) {
await updateStore({
name: route.locations.map(l => l.lat + "-" + l.lon).join(";"),
type: "route"
}, null);
await updateStore(
{
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
type: "route",
},
null,
);
isSaved = false;
// view.back();
} else {
const name = prompt("Trip name?");
if (!name) return;
await updateStore({
name: route.locations.map(l => l.lat + "-" + l.lon).join(";"),
type: "route"
}, {
...route,
name
})
await updateStore(
{
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
type: "route",
},
{
...route,
name,
},
);
isSaved = true;
}
}}

View File

@ -18,7 +18,12 @@
import { view } from "../../view.svelte";
import { m } from "$lang/messages";
import { setOnboardingState } from "$lib/onboarding.svelte";
import { getDB, stores, syncStores, updateStore } from "$lib/services/stores.svelte";
import {
getDB,
stores,
syncStores,
updateStore,
} from "$lib/services/stores.svelte";
const dev = getDeveloperToggle();

View File

@ -83,7 +83,7 @@ export async function syncStores() {
if (!(await hasCapability("stores"))) {
return;
}
if (!(localStorage.getItem("lnv-token"))) {
if (!localStorage.getItem("lnv-token")) {
return;
}
const db = await getDB();