Browse Source
exchange_rate: (fix) rm need to restart app to disable FX rates
Previously if the user disabled FX rates in the settings, the UI
would keep showing the fiat amounts everywhere until the next time
the program was started. (and the rates would not even refresh anymore)
patch-4
SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
1 deletions
electrum/exchange_rate.py
@ -577,7 +577,7 @@ class FxThread(ThreadJob):
def show_history ( self ) :
def show_history ( self ) :
return self . is_enabled ( ) and self . get_history_config ( ) and self . ccy in self . exchange . history_ccys ( )
return self . is_enabled ( ) and self . get_history_config ( ) and self . ccy in self . exchange . history_ccys ( )
def set_currency ( self , ccy ) :
def set_currency ( self , ccy : str ) :
self . ccy = ccy
self . ccy = ccy
self . config . set_key ( ' currency ' , ccy , True )
self . config . set_key ( ' currency ' , ccy , True )
self . trigger_update ( )
self . trigger_update ( )
@ -607,6 +607,8 @@ class FxThread(ThreadJob):
def exchange_rate ( self ) - > Decimal :
def exchange_rate ( self ) - > Decimal :
""" Returns the exchange rate as a Decimal """
""" Returns the exchange rate as a Decimal """
if not self . is_enabled ( ) :
return Decimal ( ' NaN ' )
rate = self . exchange . quotes . get ( self . ccy )
rate = self . exchange . quotes . get ( self . ccy )
if rate is None :
if rate is None :
return Decimal ( ' NaN ' )
return Decimal ( ' NaN ' )