From 69eb0f3f475187fb4937cd4f53cc016d5ea0dbcd Mon Sep 17 00:00:00 2001
From: Sander van Grieken <sander@outrightsolutions.nl>
Date: Thu, 12 May 2022 10:22:39 +0200
Subject: [PATCH] also move new-quotes event to FiatField

---
 electrum/gui/qml/components/Receive.qml            |  9 ---------
 electrum/gui/qml/components/Send.qml               |  9 ---------
 electrum/gui/qml/components/controls/FiatField.qml | 10 ++++++++++
 3 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/electrum/gui/qml/components/Receive.qml b/electrum/gui/qml/components/Receive.qml
index f53b865dd..92507eccb 100644
--- a/electrum/gui/qml/components/Receive.qml
+++ b/electrum/gui/qml/components/Receive.qml
@@ -230,13 +230,4 @@ Pane {
         }
     }
 
-    Connections {
-        target: Daemon.fx
-        function onQuotesUpdated() {
-            amountFiat.text = amount.text == ''
-                ? ''
-                : Daemon.fx.fiatValue(Config.unitsToSats(amount.text))
-        }
-    }
-
 }
diff --git a/electrum/gui/qml/components/Send.qml b/electrum/gui/qml/components/Send.qml
index 1fbcdc458..06d614617 100644
--- a/electrum/gui/qml/components/Send.qml
+++ b/electrum/gui/qml/components/Send.qml
@@ -244,15 +244,6 @@ Pane {
         }
     }
 
-    Connections {
-        target: Daemon.fx
-        function onQuotesUpdated() {
-            amountFiat.text = amount.text == ''
-                ? ''
-                : Daemon.fx.fiatValue(Config.unitsToSats(amount.text))
-        }
-    }
-
     // make clicking the dialog background move the scope away from textedit fields
     // so the keyboard goes away
     MouseArea {
diff --git a/electrum/gui/qml/components/controls/FiatField.qml b/electrum/gui/qml/components/controls/FiatField.qml
index cff9a7cad..59cb0f180 100644
--- a/electrum/gui/qml/components/controls/FiatField.qml
+++ b/electrum/gui/qml/components/controls/FiatField.qml
@@ -15,4 +15,14 @@ TextField {
         if (amountFiat.activeFocus)
             btcfield.text = text == '' ? '' : Config.satsToUnits(Daemon.fx.satoshiValue(amountFiat.text))
     }
+
+    Connections {
+        target: Daemon.fx
+        function onQuotesUpdated() {
+            amountFiat.text = btcfield.text == ''
+                ? ''
+                : Daemon.fx.fiatValue(Config.unitsToSats(btcfield.text))
+        }
+    }
+
 }