diff options
| -rw-r--r-- | src/components/Account.svelte | 3 | ||||
| -rw-r--r-- | src/components/Items.svelte | 4 | ||||
| -rw-r--r-- | src/routes/(app)/+layout.server.ts | 1 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+page.server.ts | 1 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+page.svelte | 14 | ||||
| -rw-r--r-- | src/routes/(app)/invoice/[id]/paid/+page.svelte | 2 | ||||
| -rw-r--r-- | src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte | 12 | ||||
| -rw-r--r-- | src/routes/(app)/sent/+page.svelte | 2 |
8 files changed, 25 insertions, 14 deletions
diff --git a/src/components/Account.svelte b/src/components/Account.svelte index f83068b5..ab24f56a 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -8,6 +8,9 @@ let { seed, balance, id } = account; $: type = seed ? "Savings" : "Cash"; + $: refresh(account); + let refresh = (a) => ({ seed, balance, id } = a) + let setAccount = () => document.cookie = `account=${id}; path=/; max-age=86400`; </script> diff --git a/src/components/Items.svelte b/src/components/Items.svelte index f991e114..47966d8e 100644 --- a/src/components/Items.svelte +++ b/src/components/Items.svelte @@ -15,7 +15,7 @@ import DeleteItem from "$comp/DeleteItem.svelte"; import Icon from "$comp/Icon.svelte"; - export let subject, user, items, rate, currency; + export let subject, user, items, rate, currency, total; let flipDurationMs = 200; let dropTargetStyle = {}; @@ -28,8 +28,6 @@ deleting = item; }; - $: total = items.reduce((a, b) => a + b.price * b.quantity, 0); - function handleConsider(e) { const { items: newItems, diff --git a/src/routes/(app)/+layout.server.ts b/src/routes/(app)/+layout.server.ts index a0e30f31..e4105fb8 100644 --- a/src/routes/(app)/+layout.server.ts +++ b/src/routes/(app)/+layout.server.ts @@ -44,6 +44,7 @@ export async function load({ cookies, request, url, params }) { } if (user && !user.pubkey && !pathname.includes("generate")) { + console.log("user missing pubkey", user) redirect(303, `/${user.username}/generate`); } diff --git a/src/routes/(app)/[username]/(profile)/+page.server.ts b/src/routes/(app)/[username]/(profile)/+page.server.ts index 9c9be68a..ed4ee58c 100644 --- a/src/routes/(app)/[username]/(profile)/+page.server.ts +++ b/src/routes/(app)/[username]/(profile)/+page.server.ts @@ -1,6 +1,7 @@ import { auth, get } from "$lib/utils"; export async function load({ cookies, depends, parent }) { + depends("app:payments"); depends("app:items"); let { subject } = await parent(); diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index 98b77fc9..03fbc454 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -14,7 +14,7 @@ $: rate = rates[currency]; $: total = items.reduce((a, b) => a + b.price * b.quantity, 0); - let refresh = (d) => ({ items, subject, user, rates } = d); + let refresh = (d) => ({ accounts, items, subject, user, rates } = d); $: refresh(data); let install = async () => { @@ -41,16 +41,16 @@ {/each} <div class="flex justify-center gap-2"> - <button - class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-black text-white w-full justify-center" - > - <a href={`/account/setup`}> + <a href={`/account/setup`} class="contents"> + <button + class="rounded-2xl border py-5 px-6 font-bold hover:opacity-80 flex bg-black text-white w-full justify-center" + > <div class="mx-auto flex gap-2"> <Icon icon="plus" style="w-8 mx-auto invert" /> <div class="my-auto text-xl whitespace-nowrap">Add account</div> </div> - </a> - </button> + </button> + </a> {#if $installPrompt} <button diff --git a/src/routes/(app)/invoice/[id]/paid/+page.svelte b/src/routes/(app)/invoice/[id]/paid/+page.svelte index 80d5fe6e..e4279e48 100644 --- a/src/routes/(app)/invoice/[id]/paid/+page.svelte +++ b/src/routes/(app)/invoice/[id]/paid/+page.svelte @@ -76,7 +76,7 @@ {/if} </div> -<a href={`/`}> +<a href={`/${user.username}`}> <div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" /> </a> diff --git a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte index 0630948c..f6c6980d 100644 --- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte +++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte @@ -6,7 +6,15 @@ import Icon from "$comp/Icon.svelte"; import Spinner from "$comp/Spinner.svelte"; import { page } from "$app/stores"; - import { fiat as toFiat, f, focus, s, sat, closest, network } from "$lib/utils"; + import { + fiat as toFiat, + f, + focus, + s, + sat, + closest, + network, + } from "$lib/utils"; import { pin } from "$lib/store"; import { goto, invalidate } from "$app/navigation"; import { rate } from "$lib/store"; @@ -36,6 +44,7 @@ goto(result.location); } else { await applyAction(result); + invalidate("app:payments"); } }; }; @@ -55,7 +64,6 @@ let key = child.derive(path); let { privateKey, publicKey } = key; let address = btc.getAddress("wpkh", privateKey, network); - console.log("ADDR", address) tx.signIdx(privateKey, i); } tx.finalize(); diff --git a/src/routes/(app)/sent/+page.svelte b/src/routes/(app)/sent/+page.svelte index 12e13c41..7d67ac03 100644 --- a/src/routes/(app)/sent/+page.svelte +++ b/src/routes/(app)/sent/+page.svelte @@ -43,7 +43,7 @@ </h3> </div> -<a href={`/payments`} use:focus> +<a href={`/${username}`} use:focus> <div class="opacity-0 w-screen h-screen fixed top-0 left-0 z-50" /> </a> |
