Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make small fixes #7503

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fun EtfPage(
DescriptionCard(
title,
description,
ImageSource.Remote("https://cdn.blocksdecoded.com/category-icons/lending@3x.png")
ImageSource.Remote("https://cdn.blocksdecoded.com/header-images/ETF_bitcoin@3x.png")
)
}
item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class EtfViewModel(

private fun etfViewItem(etf: Etf, timeDuration: TimeDuration) = EtfViewItem(
title = etf.ticker,
iconUrl = "https://cdn.blocksdecoded.com/header-images/${etf.ticker.lowercase()}@3x.png",
iconUrl = "https://cdn.blocksdecoded.com/etf-tresuries/${etf.ticker}@3x.png",
subtitle = etf.name,
value = etf.totalAssets?.let {
App.numberFormatter.formatFiatShort(it, currencyManager.baseCurrency.symbol, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ class MetricsPageViewModel(
else -> throw Exception("MetricsType not supported")
}

private val icon = when(metricsType) {
MetricsType.Volume24h -> "total_volume"
MetricsType.TotalMarketCap -> "total_mcap"
else -> throw Exception("MetricsType not supported")
}

private val header = MarketModule.Header(
title = Translator.getString(title),
description = Translator.getString(description),
icon = ImageSource.Remote("https://cdn.blocksdecoded.com/header-images/total_volume@3x.png")
icon = ImageSource.Remote("https://cdn.blocksdecoded.com/header-images/$icon@3x.png")
)

override fun createState(): MetricsPageModule.UiState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@ class MarketPostService(
private val backgroundManager: BackgroundManager,
) : BackgroundManager.Listener {
private val coroutineScope = CoroutineScope(Dispatchers.Default)
private var xxxJob: Job? = null
private var job: Job? = null

private val stateSubject = BehaviorSubject.create<DataState<List<Post>>>()
val stateObservable: Observable<DataState<List<Post>>>
get() = stateSubject

init {
backgroundManager.registerListener(this)
fetchPosts()
}

private fun fetchPosts() {
xxxJob?.cancel()
xxxJob = coroutineScope.launch {
job?.cancel()
job = coroutineScope.launch {
try {
val posts = marketKit.postsSingle().await()
stateSubject.onNext(DataState.Success(posts))
Expand Down
Loading