From e05b0658d12ee2ba1c47c8fbded464e920773475 Mon Sep 17 00:00:00 2001
From: sneurlax <sneurlax@gmail.com>
Date: Thu, 26 Jan 2023 10:58:00 -0600
Subject: [PATCH] only validate fiat amounts

TODO make sure exchange rate doesn't push fiat value over max
---
 lib/pages/buy_view/buy_form.dart | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart
index 4dc13aeda..c55226d6d 100644
--- a/lib/pages/buy_view/buy_form.dart
+++ b/lib/pages/buy_view/buy_form.dart
@@ -1262,11 +1262,15 @@ class NumericalRangeFormatter extends TextInputFormatter {
   ) {
     if (newValue.text == '') {
       return newValue;
-    } else if (Decimal.parse(newValue.text) < min) {
-      newValue =
-          const TextEditingValue().copyWith(text: min.toStringAsFixed(2));
     } else {
-      newValue = Decimal.parse(newValue.text) > max ? oldValue : newValue;
+      if (buyWithFiat) {
+        if (Decimal.parse(newValue.text) < min) {
+          newValue =
+              const TextEditingValue().copyWith(text: min.toStringAsFixed(2));
+        } else {
+          newValue = Decimal.parse(newValue.text) > max ? oldValue : newValue;
+        }
+      }
     }
 
     final regexString = buyWithFiat