From fbf41b582a151c6bfa74caf0507d3455bddedba9 Mon Sep 17 00:00:00 2001 From: gruve-p Date: Fri, 16 Jun 2023 13:55:58 +0200 Subject: [PATCH] kivy: fix fx history rates --- electrum/gui/kivy/uix/dialogs/fx_dialog.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/electrum/gui/kivy/uix/dialogs/fx_dialog.py b/electrum/gui/kivy/uix/dialogs/fx_dialog.py index ef348b873..3eeee5d27 100644 --- a/electrum/gui/kivy/uix/dialogs/fx_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/fx_dialog.py @@ -89,12 +89,9 @@ class FxDialog(Factory.Popup): self.config = config self.callback = callback self.fx = self.app.fx - if self.fx.get_history_config(allow_none=True) is None: - # If nothing is set, force-enable it. (Note that as fiat rates itself - # are disabled by default, it is enough to set this here. If they - # were enabled by default, this would be too late.) - self.fx.set_history_config(True) - self.has_history_rates = self.fx.get_history_config() + if not self.fx.config.cv.FX_HISTORY_RATES.is_set(): + self.fx.config.FX_HISTORY_RATES = True # override default + self.has_history_rates = self.fx.config.FX_HISTORY_RATES Factory.Popup.__init__(self) self.add_currencies() @@ -128,7 +125,7 @@ class FxDialog(Factory.Popup): self.ids.ccy.text = my_ccy def on_checkbox_history(self, checked): - self.fx.set_history_config(checked) + self.fx.config.FX_HISTORY_RATES = bool(checked) self.has_history_rates = checked self.add_currencies() self.on_currency(self.ids.ccy.text)