diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index 168c69dc4..8faccf7a5 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -516,8 +516,11 @@ class FxThread(ThreadJob): self.config.set_key('use_exchange_rate', bool(b)) self.trigger_update() - def get_history_config(self, *, default=False): - return bool(self.config.get('history_rates', default)) + def get_history_config(self, *, allow_none=False): + val = self.config.get('history_rates', None) + if val is None and allow_none: + return None + return bool(val) def set_history_config(self, b): self.config.set_key('history_rates', bool(b)) diff --git a/electrum/gui/kivy/uix/dialogs/fx_dialog.py b/electrum/gui/kivy/uix/dialogs/fx_dialog.py index 4d4a99d5d..ef348b873 100644 --- a/electrum/gui/kivy/uix/dialogs/fx_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/fx_dialog.py @@ -89,7 +89,12 @@ class FxDialog(Factory.Popup): self.config = config self.callback = callback self.fx = self.app.fx - self.has_history_rates = self.fx.get_history_config(default=True) + 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() Factory.Popup.__init__(self) self.add_currencies()