diff options
| author | Adam Soltys <[email protected]> | 2023-01-31 23:11:49 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-31 23:11:49 -0800 |
| commit | 7611315ae6de9bf9592bfd65d841aa2b33d06e57 (patch) | |
| tree | a7441d19144c1823a509660cb0a7e283a91dd36f /src/routes/(app)/send | |
| parent | cf29dcc02e2c9ac593d6e8f0aff2589b80ffa994 (diff) | |
| download | coinos-ui-7611315ae6de9bf9592bfd65d841aa2b33d06e57.tar.gz coinos-ui-7611315ae6de9bf9592bfd65d841aa2b33d06e57.zip | |
classic payments
Diffstat (limited to 'src/routes/(app)/send')
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.server.js | 5 | ||||
| -rw-r--r-- | src/routes/(app)/send/[uuid=uuid]/+page.server.js | 2 |
2 files changed, 6 insertions, 1 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 }; |
