aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/AppHeader.svelte20
-rw-r--r--src/components/RegisterOrLogin.svelte2
-rw-r--r--src/lib/socket.js4
-rw-r--r--src/lib/utils.js2
-rw-r--r--src/routes/[username]/index.js2
-rw-r--r--src/routes/[username]/index.svelte2
-rw-r--r--src/routes/[username]/receive.svelte3
-rw-r--r--src/routes/__layout.svelte2
-rw-r--r--src/routes/invoice/[id].js1
-rw-r--r--src/routes/invoice/index.js9
-rw-r--r--src/routes/logout/done.svelte20
-rw-r--r--src/routes/logout/index.js40
12 files changed, 53 insertions, 54 deletions
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte
index 99eea6d5..1c6f639c 100644
--- a/src/components/AppHeader.svelte
+++ b/src/components/AppHeader.svelte
@@ -8,19 +8,19 @@
<header class="bg-gradient-to-r from-primary to-gradient h-[20vh] w-full relative">
<nav class="flex justify-end items-center space-x-4 p-5">
- <a href={`/${$user.username}/receive`}>
- <button class="bg-white p-2 rounded-full w-12 h-12"
- ><Icon icon="numpad" style="mx-auto" /></button
- >
- </a>
+ <a href={`/${$user.username}/receive`}>
+ <button class="bg-white p-2 rounded-full w-12 h-12"
+ ><Icon icon="numpad" style="mx-auto" /></button
+ >
+ </a>
<button class="bg-white p-2 rounded-full w-12 h-12"
><Icon icon="clock" style="mx-auto" /></button
>
- <a href={`/${$user.username}`}>
- <button class="bg-white p-2 rounded-full w-12 h-12"
- ><Icon icon="profile" style="mx-auto" /></button
- >
- </a>
+ <a href={`/${$user.username}`}>
+ <button class="bg-white p-2 rounded-full w-12 h-12"
+ ><Icon icon="profile" style="mx-auto" /></button
+ >
+ </a>
<button class="bg-white p-2 rounded-full w-12 h-12"
><Icon icon="menu" style="mx-auto" /></button
>
diff --git a/src/components/RegisterOrLogin.svelte b/src/components/RegisterOrLogin.svelte
index 56b96499..3b51346b 100644
--- a/src/components/RegisterOrLogin.svelte
+++ b/src/components/RegisterOrLogin.svelte
@@ -22,7 +22,7 @@
if (!r.token) r = await post('/login', { username, password });
$token = r.token;
auth();
- user.subscribe(({ username }) => goto(`/${username}/receive`));
+ user.subscribe(({ username }) => goto(`/${username}/receive`));
};
</script>
diff --git a/src/lib/socket.js b/src/lib/socket.js
index 14555bd3..36d41ea8 100644
--- a/src/lib/socket.js
+++ b/src/lib/socket.js
@@ -47,8 +47,8 @@ export function connect() {
}
export function close() {
- if (socket) socket.close();
-}
+ if (socket) socket.close();
+}
function onWebsocketMessage(msg) {
let { type, data } = JSON.parse(msg.data);
diff --git a/src/lib/utils.js b/src/lib/utils.js
index e9d1b73e..22c88522 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -8,7 +8,7 @@ const base = browser ? '' : import.meta.env.VITE_COINOS_URL;
export const get = (url) =>
fetch(base + url, {
- headers: { accept: 'application/json'}
+ headers: { accept: 'application/json' }
}).then((r) => r.json());
export const post = (url, body) =>
diff --git a/src/routes/[username]/index.js b/src/routes/[username]/index.js
index 39a216c2..01613574 100644
--- a/src/routes/[username]/index.js
+++ b/src/routes/[username]/index.js
@@ -1,3 +1,3 @@
export async function GET({ params }) {
- return { body: params }
+ return { body: params };
}
diff --git a/src/routes/[username]/index.svelte b/src/routes/[username]/index.svelte
index fe1f7754..91744aa3 100644
--- a/src/routes/[username]/index.svelte
+++ b/src/routes/[username]/index.svelte
@@ -2,8 +2,6 @@
import { AppHeader, Icon } from '$comp';
import { user } from '$lib/store';
export let username;
-
- console.log($user, username);
</script>
{#if $user?.username === username}
diff --git a/src/routes/[username]/receive.svelte b/src/routes/[username]/receive.svelte
index d588eaed..5865d5e5 100644
--- a/src/routes/[username]/receive.svelte
+++ b/src/routes/[username]/receive.svelte
@@ -94,8 +94,7 @@
};
let submit = async () => {
- let { id } = await post('/invoice', { amount, rate: $rate, username: $page.params.username });
- console.log(id)
+ let { id } = await post('/invoice', { amount, rate: $rate, username: $page.params.username });
goto(`/invoice/${id}`);
};
</script>
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte
index 1e4e2560..85f5a817 100644
--- a/src/routes/__layout.svelte
+++ b/src/routes/__layout.svelte
@@ -25,6 +25,6 @@
</script>
{#if ready}
-<SvelteToast />
+ <SvelteToast />
<slot />
{/if}
diff --git a/src/routes/invoice/[id].js b/src/routes/invoice/[id].js
index 7d18ba86..9a38604f 100644
--- a/src/routes/invoice/[id].js
+++ b/src/routes/invoice/[id].js
@@ -6,7 +6,6 @@ const username = 'bob',
export async function GET({ params }) {
let { id } = params;
let huh = await get(`/invoice?uuid=${id}`);
- console.log(huh)
let { amount, rate, text } = await get(`/invoice?uuid=${id}`);
return { body: { amount, rate, text } };
diff --git a/src/routes/invoice/index.js b/src/routes/invoice/index.js
index d89f7130..f6b1f2cf 100644
--- a/src/routes/invoice/index.js
+++ b/src/routes/invoice/index.js
@@ -3,9 +3,12 @@ import { post } from '$lib/utils';
let network = 'lightning';
export async function POST({ request }) {
- let { amount, rate, username } = await request.json();
- let { text } = await post('/lightning/invoice', );
- let { uuid: id } = await post('/invoice', { invoice: { amount, currency: 'USD', network, rate, text }, user: { username } });
+ let { amount, rate, username } = await request.json();
+ let { text } = await post('/lightning/invoice');
+ let { uuid: id } = await post('/invoice', {
+ invoice: { amount, currency: 'USD', network, rate, text },
+ user: { username }
+ });
return { body: { id } };
}
diff --git a/src/routes/logout/done.svelte b/src/routes/logout/done.svelte
index 894c7b99..50fb766e 100644
--- a/src/routes/logout/done.svelte
+++ b/src/routes/logout/done.svelte
@@ -1,13 +1,13 @@
<script>
- import { onMount } from "svelte";
- import { user, token } from "$lib/store";
- import { goto } from "$app/navigation";
- import { close } from "$lib/socket";
+ import { onMount } from 'svelte';
+ import { user, token } from '$lib/store';
+ import { goto } from '$app/navigation';
+ import { close } from '$lib/socket';
- onMount(() => {
- $token = null;
- $user = null;
- close();
- goto('/');
- });
+ onMount(() => {
+ $token = null;
+ $user = null;
+ close();
+ goto('/');
+ });
</script>
diff --git a/src/routes/logout/index.js b/src/routes/logout/index.js
index 80e65f8b..6cbae8f2 100644
--- a/src/routes/logout/index.js
+++ b/src/routes/logout/index.js
@@ -1,26 +1,26 @@
-import cookie from "cookie";
+import cookie from 'cookie';
const opts = {
- httpOnly: true,
- sameSite: "lax",
- path: "/",
+ httpOnly: true,
+ sameSite: 'lax',
+ path: '/'
};
export async function GET({ request: { headers } }) {
- return {
- status: 302,
- headers: {
- location: "/logout/done",
- "set-cookie": [
- cookie.serialize("token", "", {
- ...opts,
- expires: new Date(0),
- }),
- cookie.serialize("refresh_token", "", {
- ...opts,
- expires: new Date(0),
- }),
- ],
- },
- };
+ return {
+ status: 302,
+ headers: {
+ location: '/logout/done',
+ 'set-cookie': [
+ cookie.serialize('token', '', {
+ ...opts,
+ expires: new Date(0)
+ }),
+ cookie.serialize('refresh_token', '', {
+ ...opts,
+ expires: new Date(0)
+ })
+ ]
+ }
+ };
}