diff options
4 files changed, 14 insertions, 9 deletions
diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index b46e31d6..c9731299 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -59,9 +59,9 @@ payments = payments.map((p) => ({ ...p, created: new Date(p.created), - fiat: f(((p.amount || 0) * p.rate) / sats, p.currency), - fiatfee: f(((p.fee || 0) * p.rate) / sats, p.currency), - fiattip: f(((p.tip || 0) * p.rate) / sats, p.currency) + amount_fiat: f((p.amount * p.rate) / sats, p.currency), + fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, + tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null })); let keys = [ @@ -73,9 +73,9 @@ 'amount', 'fee', 'tip', - 'fiat', - 'fiatfee', - 'fiattip' + 'amount_fiat', + 'fee_fiat', + 'tip_fiat' ]; let csv = @@ -191,7 +191,7 @@ <div class="text-secondary flex"> {#if p.type === types.lightning} <div class="text-3xl">⚡️</div> - {:else} + {:else if p.type === types.bitcoin} <div class="my-auto mr-1"> <img src="/images/bitcoin.svg" diff --git a/src/routes/(app)/invoice/[hash]/+layout.server.js b/src/routes/(app)/invoice/[hash]/+layout.server.js index 61a479ab..d38f945f 100644 --- a/src/routes/(app)/invoice/[hash]/+layout.server.js +++ b/src/routes/(app)/invoice/[hash]/+layout.server.js @@ -6,7 +6,7 @@ export async function load({ depends, params, url }) { depends('app:invoice'); let { hash } = params; - let invoice = await get(`/invoice?hash=${hash}`); + let invoice = await get(`/invoice/${hash}`); let { amount, received } = invoice; amount = parseInt(amount); 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 }; |
