From 0e0f39af2e6585d7b61cf67652cdc0c2b2f06eb8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 18 Jan 2023 19:44:27 -0800 Subject: pots --- src/routes/(app)/tx/[id]/+page.server.js | 2 +- src/routes/(app)/tx/[id]/+page.svelte | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/routes/(app)/tx') diff --git a/src/routes/(app)/tx/[id]/+page.server.js b/src/routes/(app)/tx/[id]/+page.server.js index 7db5d4f1..cbd7355e 100644 --- a/src/routes/(app)/tx/[id]/+page.server.js +++ b/src/routes/(app)/tx/[id]/+page.server.js @@ -2,5 +2,5 @@ import { auth, get } from '$lib/utils'; export async function load({ cookies, params }) { let tx = await get(`/payments/${params.id}`, auth(cookies)); - return { tx }; + return { tx }; } diff --git a/src/routes/(app)/tx/[id]/+page.svelte b/src/routes/(app)/tx/[id]/+page.svelte index 63e45f17..a2bb1459 100644 --- a/src/routes/(app)/tx/[id]/+page.svelte +++ b/src/routes/(app)/tx/[id]/+page.svelte @@ -2,13 +2,15 @@ import { t } from '$lib/translations'; import { back, copy, f, s, sats } from '$lib/utils'; import { Avatar, Icon } from '$comp'; - import { format, parseISO } from 'date-fns'; + import { format } from 'date-fns'; import { PUBLIC_EXPLORER as expl } from '$env/static/public'; export let data; let { user, tx } = data; let { username } = user; - let { amount, hash, createdAt, rate, network, preimage, fee, currency } = tx; + let { amount, hash, created, rate, type, preimage, fee, currency } = tx; + fee = fee || 0; + let fiat = (Math.abs(amount) * rate) / sats; @@ -32,12 +34,12 @@
{$t('payments.date')}
- {format(parseISO(createdAt), 'MMMM d')}, - {format(parseISO(createdAt), 'h:mm aaa')} + {format(new Date(created), 'MMMM d')}, + {format(new Date(created), 'h:mm aaa')}
- {#if network === 'lightning'} + {#if type === 'lightning'}
{$t('payments.preimage')}
@@ -47,16 +49,14 @@ {:else}
{$t('payments.id')}
-
-
- {hash} +
+
+ {hash} +
+
- -
{/if}
-- cgit v1.2.3