aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-26 20:54:49 -0800
committerAdam Soltys <[email protected]>2024-11-26 20:54:49 -0800
commit872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0 (patch)
tree4d505c5b7c3f137b56c84cfaca12ed486aa4972c /src/routes/(app)/send
parentf9300236a3c0227e0eec58326fa322e58613bc2d (diff)
downloadcoinos-ui-872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0.tar.gz
coinos-ui-872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0.zip
warnings
Diffstat (limited to 'src/routes/(app)/send')
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index d2b3727c..f0811f2e 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -13,32 +13,23 @@
import Numpad from "$comp/Numpad.svelte";
import Spinner from "$comp/Spinner.svelte";
import { page } from "$app/stores";
- import {
- btc,
- sat,
- post,
- back,
- f,
- toFiat,
- s,
- sats,
- focus,
- } from "$lib/utils";
+ import { btc, sat, post, back, f, toFiat, s, sats, focus } from "$lib/utils";
let { data, form } = $props();
let { invoice, rates, user } = $state(data);
let { address, hash, payreq, user: recipient, tip } = $state(invoice);
let { currency } = $state(user);
+ let { amount } = $state(form || invoice);
- let amount = $state(form?.amount || invoice.amount);
let rate = $derived(
invoice.rate * (rates[user.currency] / rates[invoice.currency]),
);
+
let a = $state(),
af = $state(),
- fiat = $state(!amount);
+ fiat = $state(untrack(() => !amount));
- let amountFiat = $state(amount * (rate / sats));
+ let amountFiat = $state((untrack(() => amount) * untrack(() => rate)) / sats);
let setAmount = () => {
amount = a;
amountFiat = af;