mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-30 08:51:32 +00:00
kivy fx dialog: fix #5329
This commit is contained in:
parent
fd58a0cb20
commit
d2a80f15a1
1 changed files with 8 additions and 3 deletions
|
@ -95,15 +95,20 @@ class FxDialog(Factory.Popup):
|
||||||
self.add_currencies()
|
self.add_currencies()
|
||||||
|
|
||||||
def add_exchanges(self):
|
def add_exchanges(self):
|
||||||
|
ex = self.ids.exchanges
|
||||||
if self.fx.is_enabled():
|
if self.fx.is_enabled():
|
||||||
exchanges = sorted(self.fx.get_exchanges_by_ccy(self.fx.get_currency(), self.has_history_rates))
|
exchanges = sorted(self.fx.get_exchanges_by_ccy(self.fx.get_currency(), self.has_history_rates))
|
||||||
mx = self.fx.exchange.name()
|
mx = self.fx.exchange.name()
|
||||||
|
if mx in exchanges:
|
||||||
|
ex.text = mx
|
||||||
|
elif exchanges:
|
||||||
|
ex.text = exchanges[0]
|
||||||
|
else:
|
||||||
|
ex.text = ''
|
||||||
else:
|
else:
|
||||||
exchanges = []
|
exchanges = []
|
||||||
mx = ''
|
ex.text = ''
|
||||||
ex = self.ids.exchanges
|
|
||||||
ex.values = exchanges
|
ex.values = exchanges
|
||||||
ex.text = (mx if mx in exchanges else exchanges[0]) if self.fx.is_enabled() else ''
|
|
||||||
|
|
||||||
def on_exchange(self, text):
|
def on_exchange(self, text):
|
||||||
if not text:
|
if not text:
|
||||||
|
|
Loading…
Add table
Reference in a new issue