mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-22 19:49:34 +00:00
main: simplify fiat ticker code
This commit is contained in:
parent
937cb98256
commit
8236277906
1 changed files with 3 additions and 7 deletions
10
main.qml
10
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 "?.??";
|
||||
|
|
Loading…
Reference in a new issue