aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-01 10:04:29 -0800
committerAdam Soltys <[email protected]>2023-02-01 10:04:29 -0800
commitc26727b1bab7398f94520fa10a502957c99fcab7 (patch)
treee822737fdda40b66da8653b65203ccfc5397e877 /src/routes/(app)/send
parent4514e5cf43069c552fed9f5f975d08664ca0d3b9 (diff)
parent5085ef51412bc4d1e18bdabf29cd9fe3f7183e1c (diff)
downloadcoinos-ui-c26727b1bab7398f94520fa10a502957c99fcab7.tar.gz
coinos-ui-c26727b1bab7398f94520fa10a502957c99fcab7.zip
Merge branch 'master' into staging
Diffstat (limited to 'src/routes/(app)/send')
-rw-r--r--src/routes/(app)/send/[...text]/+page.server.js5
-rw-r--r--src/routes/(app)/send/[uuid=uuid]/+page.server.js2
-rw-r--r--src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js
index 8e5e02d7..3d25ed7e 100644
--- a/src/routes/(app)/send/[...text]/+page.server.js
+++ b/src/routes/(app)/send/[...text]/+page.server.js
@@ -21,6 +21,11 @@ let parse = async (t, host) => {
} catch (e) {}
}
+ if (t.endsWith('@classic')) {
+ ({ uuid: id } = await get(`/invoice/classic/${t.replace('@classic', '')}`));
+ if (id) throw redirect(307, `/send/${id}`);
+ }
+
if (t.includes('/pot')) throw redirect(307, t.substring(t.indexOf('/pot')));
if (t.toLowerCase().startsWith('lnurl')) throw redirect(307, `/ln/${t}`);
diff --git a/src/routes/(app)/send/[uuid=uuid]/+page.server.js b/src/routes/(app)/send/[uuid=uuid]/+page.server.js
index 7fa613bf..a59853d3 100644
--- a/src/routes/(app)/send/[uuid=uuid]/+page.server.js
+++ b/src/routes/(app)/send/[uuid=uuid]/+page.server.js
@@ -4,7 +4,7 @@ import { btc as asset, auth, get, post } from '$lib/utils';
export async function load({ params, parent }) {
let { user } = await parent();
- let { amount, address, tip, text, user: recipient } = await get(`/invoice/${params.id}`);
+ let { amount, address, tip, text, user: recipient } = await get(`/invoice/${params.uuid}`);
if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' });
if (tip) amount += tip;
return { amount, address, payreq: text, recipient };
diff --git a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
index 0da8ea10..6b216cb3 100644
--- a/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
+++ b/src/routes/(app)/send/bitcoin/[address]/[...amount]/+page.svelte
@@ -40,7 +40,7 @@
<Numpad bind:amount {currency} {submit} />
<form method="POST" use:enhance on:submit={toggle}>
- <input name="ts" value={Date.now()} type="hidden" />
+ <input name="ts" value={Date.now()} type="hidden" />
<input name="address" value={address} type="hidden" />
<input name="amount" value={amount} type="hidden" />
<input name="pin" value={$pin} type="hidden" />