aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-01-25 10:27:04 -0800
committerAdam Soltys <[email protected]>2023-01-25 10:27:04 -0800
commit2a18749cb9b08726dedf0cfb63971305e50a910a (patch)
tree0fe5d725d782fdac85d4776658c6e7150eba5a05 /src
parent32176742969796afdede9840c1c68a9343ec21af (diff)
downloadcoinos-ui-2a18749cb9b08726dedf0cfb63971305e50a910a.tar.gz
coinos-ui-2a18749cb9b08726dedf0cfb63971305e50a910a.zip
cap numpad amount
Diffstat (limited to 'src')
-rw-r--r--src/components/Numpad.svelte8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte
index e688cc6e..74844b71 100644
--- a/src/components/Numpad.svelte
+++ b/src/components/Numpad.svelte
@@ -119,7 +119,12 @@
let prev = '';
let input = (e) => {
- if (html.length > 12) return (html = prev);
+ if (amount > sats) {
+ if (fiat) amountFiat = (Math.round(sats * ($selectedRate / sats))).toString();
+ else amountSats = sats;
+ return warning($t('user.receive.lessThan1BTCWarning'));
+ }
+
if (prev === '0' && html.length === 2) {
prev = '';
html = html.replace('0', '');
@@ -130,7 +135,6 @@
if (!fiat) amountSats = parseInt(html.replace(/,/g, ''));
if (!amountSats) amountSats = null;
- if (amountSats > sats) amountSats = sats;
setTimeout(() => {
let p = prev.split(',')[0].length;