mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 12:54:30 +00:00
Merge pull request #3504
8236277
main: simplify fiat ticker code (selsta)
This commit is contained in:
commit
6e87e2cb5b
1 changed files with 3 additions and 7 deletions
10
main.qml
10
main.qml
|
@ -99,8 +99,7 @@ ApplicationWindow {
|
||||||
property bool themeTransition: false
|
property bool themeTransition: false
|
||||||
|
|
||||||
// fiat price conversion
|
// fiat price conversion
|
||||||
property real fiatPriceXMRUSD: 0
|
property real fiatPrice: 0
|
||||||
property real fiatPriceXMREUR: 0
|
|
||||||
property var fiatPriceAPIs: {
|
property var fiatPriceAPIs: {
|
||||||
return {
|
return {
|
||||||
"kraken": {
|
"kraken": {
|
||||||
|
@ -1201,10 +1200,7 @@ ApplicationWindow {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(persistentSettings.fiatPriceCurrency === "xmrusd")
|
appWindow.fiatPrice = ticker;
|
||||||
appWindow.fiatPriceXMRUSD = ticker;
|
|
||||||
else if(persistentSettings.fiatPriceCurrency === "xmreur")
|
|
||||||
appWindow.fiatPriceXMREUR = ticker;
|
|
||||||
|
|
||||||
appWindow.updateBalance();
|
appWindow.updateBalance();
|
||||||
}
|
}
|
||||||
|
@ -1243,7 +1239,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fiatApiConvertToFiat(amount) {
|
function fiatApiConvertToFiat(amount) {
|
||||||
var ticker = persistentSettings.fiatPriceCurrency === "xmrusd" ? appWindow.fiatPriceXMRUSD : appWindow.fiatPriceXMREUR;
|
const ticker = appWindow.fiatPrice;
|
||||||
if(ticker <= 0){
|
if(ticker <= 0){
|
||||||
fiatApiError("Invalid ticker value: " + ticker);
|
fiatApiError("Invalid ticker value: " + ticker);
|
||||||
return "?.??";
|
return "?.??";
|
||||||
|
|
Loading…
Reference in a new issue