aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2022-04-25 11:04:51 -0500
committerluigi1111 <luigi1111w@gmail.com>2022-04-25 11:04:51 -0500
commit1a6ea3302cb3e4f35cb7a0eaf3ea8043b5be48ee (patch)
tree902578229c57c9b4010f42d9211fb9f3c319ae30
parent4de4e82ee61a949b1d62ca37a0104199e0979fdd (diff)
parent37a5bdc331af9589714ed38c9804028076e079f0 (diff)
downloadmonzero-gui-1a6ea3302cb3e4f35cb7a0eaf3ea8043b5be48ee.tar.gz
monzero-gui-1a6ea3302cb3e4f35cb7a0eaf3ea8043b5be48ee.tar.xz
monzero-gui-1a6ea3302cb3e4f35cb7a0eaf3ea8043b5be48ee.zip
Merge pull request #3890
37a5bdc main: only update fiat price with open wallet (selsta)
-rw-r--r--main.qml22
-rw-r--r--pages/settings/SettingsLayout.qml3
2 files changed, 3 insertions, 22 deletions
diff --git a/main.qml b/main.qml
index 2a82a693..31450032 100644
--- a/main.qml
+++ b/main.qml
@@ -1156,13 +1156,10 @@ ApplicationWindow {
Timer {
id: fiatPriceTimer
interval: 1000 * 60;
- running: persistentSettings.fiatPriceEnabled;
+ running: persistentSettings.fiatPriceEnabled && currentWallet !== undefined
repeat: true
- onTriggered: {
- if(persistentSettings.fiatPriceEnabled)
- appWindow.fiatApiRefresh();
- }
- triggeredOnStart: false
+ onTriggered: appWindow.fiatApiRefresh()
+ triggeredOnStart: true
}
function fiatApiParseTicker(url, resp, currency){
@@ -1301,14 +1298,6 @@ ApplicationWindow {
leftPanel.balanceFiatString = bFiat;
}
- function fiatTimerStart(){
- fiatPriceTimer.start();
- }
-
- function fiatTimerStop(){
- fiatPriceTimer.stop();
- }
-
function fiatApiError(msg){
console.log("fiatPriceError: " + msg);
}
@@ -1364,11 +1353,6 @@ ApplicationWindow {
openWallet("wizard");
}
- if(persistentSettings.fiatPriceEnabled){
- appWindow.fiatApiRefresh();
- appWindow.fiatTimerStart();
- }
-
const desktopEntryEnabled = (typeof builtWithDesktopEntry != "undefined") && builtWithDesktopEntry;
if (persistentSettings.askDesktopShortcut && !persistentSettings.portable && desktopEntryEnabled) {
persistentSettings.askDesktopShortcut = false;
diff --git a/pages/settings/SettingsLayout.qml b/pages/settings/SettingsLayout.qml
index 0e54f018..5ce192ba 100644
--- a/pages/settings/SettingsLayout.qml
+++ b/pages/settings/SettingsLayout.qml
@@ -165,7 +165,6 @@ Rectangle {
if (!checked) {
console.log("Disabled price conversion");
persistentSettings.fiatPriceEnabled = false;
- appWindow.fiatTimerStop();
}
}
}
@@ -232,8 +231,6 @@ Rectangle {
onClicked: {
console.log("Enabled price conversion");
persistentSettings.fiatPriceEnabled = true;
- appWindow.fiatApiRefresh();
- appWindow.fiatTimerStart();
}
}
}