aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-15 22:13:10 -0800
committerAdam Soltys <[email protected]>2025-01-15 22:13:10 -0800
commit9a80922548964488cef66acf96e8ab70c97dabc9 (patch)
tree8fd95aae49fdfef164adf2ba8db9e9a9673037b7
parent2e8871e5c0af16a3ce4602461828efc7a213e6a7 (diff)
downloadcoinos-ui-9a80922548964488cef66acf96e8ab70c97dabc9.tar.gz
coinos-ui-9a80922548964488cef66acf96e8ab70c97dabc9.zip
fix tip sign in report
-rw-r--r--src/routes/(app)/payments/[...page]/+page.svelte10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/routes/(app)/payments/[...page]/+page.svelte b/src/routes/(app)/payments/[...page]/+page.svelte
index bde01193..d0efc6d8 100644
--- a/src/routes/(app)/payments/[...page]/+page.svelte
+++ b/src/routes/(app)/payments/[...page]/+page.svelte
@@ -81,8 +81,9 @@
payments = payments.map((p) => ({
...p,
+ tip: p.amount > 0 ? p.tip : -p.tip,
created: new Date(p.created),
- total: p.amount + (p.tip || 0),
+ total: p.amount + ((p.amount > 0 ? p.tip : -p.tip) || 0),
platform_fee: p.ourfee,
amount_fiat: f((p.amount * p.rate) / sats, p.currency),
fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null,
@@ -90,7 +91,10 @@
? f((p.ourfee * p.rate) / sats, p.currency)
: null,
tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null,
- total_fiat: f(((p.amount + (p.tip || 0)) * p.rate) / sats, p.currency),
+ total_fiat: f(
+ ((p.amount + ((p.amount > 0 ? p.tip : -p.tip) || 0)) * p.rate) / sats,
+ p.currency,
+ ),
}));
let keys = [
@@ -201,7 +205,7 @@
{/if}
</div>
- <Payments {payments} locale={locale} {user} />
+ <Payments {payments} {locale} {user} />
<div class="grid grid-cols-3 w-full text-center text-lg">
{#each Object.keys(incoming) as c}