aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-13 23:18:58 -0700
committerAdam Soltys <[email protected]>2024-09-17 09:19:26 -0700
commit6890311faca2bed1b8d22dbd88b8925f382eedd2 (patch)
tree3468812c61ca739b3953c100b6477c7393bbc88a /src/routes
parent11b981a1a58d96460d599726fe90565caa06b706 (diff)
downloadcoinos-ui-6890311faca2bed1b8d22dbd88b8925f382eedd2.tar.gz
coinos-ui-6890311faca2bed1b8d22dbd88b8925f382eedd2.zip
fix some redirects
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/(app)/+layout.server.ts1
-rw-r--r--src/routes/(app)/[username]/(profile)/+page.server.ts1
-rw-r--r--src/routes/(app)/[username]/(profile)/+page.svelte14
-rw-r--r--src/routes/(app)/invoice/[id]/paid/+page.svelte2
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte12
-rw-r--r--src/routes/(app)/sent/+page.svelte2
6 files changed, 21 insertions, 11 deletions
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>