style: run prettier
This commit is contained in:
@ -20,7 +20,7 @@
|
|||||||
alert("State mismatch. Please try again.");
|
alert("State mismatch. Please try again.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = await getOIDCUser(code, codeVerifier);
|
const token = await getOIDCUser(code, codeVerifier);
|
||||||
localStorage.setItem("lnv-id", token.id_token);
|
localStorage.setItem("lnv-id", token.id_token);
|
||||||
localStorage.setItem("lnv-token", token.access_token);
|
localStorage.setItem("lnv-token", token.access_token);
|
||||||
@ -31,5 +31,5 @@
|
|||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
await login();
|
await login();
|
||||||
location.href = "/";
|
location.href = "/";
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -8,9 +8,7 @@
|
|||||||
|
|
||||||
{#if saved.current.length != 0}
|
{#if saved.current.length != 0}
|
||||||
<div>
|
<div>
|
||||||
<h2 style="margin: 5px; margin-left: 0; font-size: 1.2em;">
|
<h2 style="margin: 5px; margin-left: 0; font-size: 1.2em;">Saved Routes</h2>
|
||||||
Saved Routes
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div style="display: flex; flex-direction: column; gap: 10px;">
|
<div style="display: flex; flex-direction: column; gap: 10px;">
|
||||||
{#each saved.current as save, _index (save.name)}
|
{#each saved.current as save, _index (save.name)}
|
||||||
@ -18,8 +16,9 @@
|
|||||||
variant="secondary"
|
variant="secondary"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
view.switch("trip", { route: save.data });
|
view.switch("trip", { route: save.data });
|
||||||
}}>{save.data.name}</Button>
|
}}>{save.data.name}</Button
|
||||||
|
>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
removeAllRoutes();
|
removeAllRoutes();
|
||||||
drawRoute(route);
|
drawRoute(route);
|
||||||
|
|
||||||
if(route) {
|
if (route) {
|
||||||
isSaved = await hasStore({
|
isSaved = await hasStore({
|
||||||
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
|
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
|
||||||
type: "route",
|
type: "route",
|
||||||
@ -59,22 +59,28 @@
|
|||||||
variant="secondary"
|
variant="secondary"
|
||||||
onclick={async () => {
|
onclick={async () => {
|
||||||
if (isSaved) {
|
if (isSaved) {
|
||||||
await updateStore({
|
await updateStore(
|
||||||
name: route.locations.map(l => l.lat + "-" + l.lon).join(";"),
|
{
|
||||||
type: "route"
|
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
|
||||||
}, null);
|
type: "route",
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
);
|
||||||
isSaved = false;
|
isSaved = false;
|
||||||
// view.back();
|
// view.back();
|
||||||
} else {
|
} else {
|
||||||
const name = prompt("Trip name?");
|
const name = prompt("Trip name?");
|
||||||
if (!name) return;
|
if (!name) return;
|
||||||
await updateStore({
|
await updateStore(
|
||||||
name: route.locations.map(l => l.lat + "-" + l.lon).join(";"),
|
{
|
||||||
type: "route"
|
name: route.locations.map((l) => l.lat + "-" + l.lon).join(";"),
|
||||||
}, {
|
type: "route",
|
||||||
...route,
|
},
|
||||||
name
|
{
|
||||||
})
|
...route,
|
||||||
|
name,
|
||||||
|
},
|
||||||
|
);
|
||||||
isSaved = true;
|
isSaved = true;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -18,7 +18,12 @@
|
|||||||
import { view } from "../../view.svelte";
|
import { view } from "../../view.svelte";
|
||||||
import { m } from "$lang/messages";
|
import { m } from "$lang/messages";
|
||||||
import { setOnboardingState } from "$lib/onboarding.svelte";
|
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();
|
const dev = getDeveloperToggle();
|
||||||
|
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export async function syncStores() {
|
|||||||
if (!(await hasCapability("stores"))) {
|
if (!(await hasCapability("stores"))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(localStorage.getItem("lnv-token"))) {
|
if (!localStorage.getItem("lnv-token")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const db = await getDB();
|
const db = await getDB();
|
||||||
|
|||||||
Reference in New Issue
Block a user