From 823627790651608ed0047f7dfec273f4434d0a9b Mon Sep 17 00:00:00 2001 From: selsta Date: Wed, 26 May 2021 01:09:30 +0200 Subject: [PATCH] main: simplify fiat ticker code --- main.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main.qml b/main.qml index 14c98857..03cde4cf 100644 --- a/main.qml +++ b/main.qml @@ -100,8 +100,7 @@ ApplicationWindow { property bool themeTransition: false // fiat price conversion - property real fiatPriceXMRUSD: 0 - property real fiatPriceXMREUR: 0 + property real fiatPrice: 0 property var fiatPriceAPIs: { return { "kraken": { @@ -1204,10 +1203,7 @@ ApplicationWindow { return; } - if(persistentSettings.fiatPriceCurrency === "xmrusd") - appWindow.fiatPriceXMRUSD = ticker; - else if(persistentSettings.fiatPriceCurrency === "xmreur") - appWindow.fiatPriceXMREUR = ticker; + appWindow.fiatPrice = ticker; appWindow.updateBalance(); } @@ -1246,7 +1242,7 @@ ApplicationWindow { } function fiatApiConvertToFiat(amount) { - var ticker = persistentSettings.fiatPriceCurrency === "xmrusd" ? appWindow.fiatPriceXMRUSD : appWindow.fiatPriceXMREUR; + const ticker = appWindow.fiatPrice; if(ticker <= 0){ fiatApiError("Invalid ticker value: " + ticker); return "?.??";