style: run prettier
This commit is contained in:
@ -31,5 +31,5 @@
|
||||
onMount(async () => {
|
||||
await login();
|
||||
location.href = "/";
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@ -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>
|
||||
|
||||
@ -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"
|
||||
}, {
|
||||
await updateStore(
|
||||
{
|
||||
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
|
||||
type: "route",
|
||||
},
|
||||
{
|
||||
...route,
|
||||
name
|
||||
})
|
||||
name,
|
||||
},
|
||||
);
|
||||
isSaved = true;
|
||||
}
|
||||
}}
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user