Skip to content

Commit

Permalink
fix(dashboard): remove duplication from list
Browse files Browse the repository at this point in the history
  • Loading branch information
adagora committed Nov 24, 2023
1 parent d1d1920 commit f22a271
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions solarathon/pages/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import requests

# some app state that outlives a single page
init_app_state = solara.reactive(["ada", "btc","bnb", "eth","doge", "agix"])
init_app_state = solara.reactive(["ada", "btc","bnb", "eth","doge", "xrp"])

@solara.component
def GeckoIcon (name: str, img: str):
Expand Down Expand Up @@ -108,7 +108,7 @@ def Page():
try:
symbols_response = requests.get(symbols_url, verify=False)
symbols_data = symbols_response.json()
available_symbols = sorted([symbol['baseAsset'].lower() for symbol in symbols_data['symbols']])
available_symbols = sorted(list(set([symbol['baseAsset'].lower() for symbol in symbols_data['symbols']])))
except Exception as e:
available_symbols = []

Expand Down Expand Up @@ -154,10 +154,10 @@ def Page():

if coingecko_data_for_symbol:
set_loading(False)
DashboardCard(data['lastPrice'], data['priceChangePercent'], GeckoIcon(data['symbol'], coingecko_data_for_symbol['image']), coingecko_data_for_symbol['market_cap'], coingecko_data_for_symbol['market_cap_change_percentage_24h'], pending=loading)
DashboardCard(data['lastPrice'], data['priceChangePercent'], GeckoIcon(data['symbol'], coingecko_data_for_symbol['image']), coingecko_data_for_symbol['market_cap'], coingecko_data_for_symbol['market_cap_change_percentage_24h'], loading)
else:
set_loading(False)
DashboardCard(data['lastPrice'], data['priceChangePercent'], data['symbol'], pending=loading)
DashboardCard(data['lastPrice'], data['priceChangePercent'], data['symbol'], loading)

except Exception as e:
print(f"An error occurred: {e}")
Expand Down

0 comments on commit f22a271

Please sign in to comment.