From 90fd57b064d3ef0176d5747b79863d6e60a22fc1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 5 Oct 2022 12:07:46 -0700 Subject: detect internal sends --- src/components/Numpad.svelte | 18 ++++++++---------- src/components/Qr.svelte | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src/components') diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 9de4a0dc..f7a18aad 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -4,10 +4,8 @@ import { f, s, post, warning, sats } from '$lib/utils'; import { t } from '$lib/translations'; - export let amount, currency; + export let amount, amountFiat = 0, currency, fiat = true; - let useFiat = true; - let amountFiat = 0; let amountSats = 0; let loading = false; @@ -28,7 +26,7 @@ KRW: '₩' }[currency] || ''; - $: amount = parseInt(useFiat ? Math.round(amountFiat / ($selectedRate / sats)) : amountSats); + $: amount = parseInt(fiat ? Math.round(amountFiat / ($selectedRate / sats)) : amountSats); $: amountSatsFormatted = s(amountSats); @@ -39,7 +37,7 @@ const numPad = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '0', '<']; const handleInput = (value) => { - if (useFiat) { + if (fiat) { if (amountFiat === 0 && value !== '.' && value !== '<' && value !== '0') { amountFiat = value; } else if ((amountFiat === 0 || amountFiat === '0') && value === '0') { @@ -89,17 +87,17 @@
- {useFiat ? `${symbol}${amountFiat}` : amountSatsFormatted}{useFiat ? currency : 'SAT'}{fiat ? currency : 'SAT'}
{useFiat ? `${amountSatsConverted} SAT` : amountFiatConverted}{fiat ? `${amountSatsConverted} SAT` : amountFiatConverted}
diff --git a/src/components/Qr.svelte b/src/components/Qr.svelte index 3456b607..0ae028b9 100644 --- a/src/components/Qr.svelte +++ b/src/components/Qr.svelte @@ -1,5 +1,5 @@