Skip to content

Commit

Permalink
Handle base currency updates
Browse files Browse the repository at this point in the history
  • Loading branch information
abdrasulov committed Jun 12, 2024
1 parent 4b8a150 commit 072e15e
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ class MarketTopCoinsViewModel2(
emitState()
}
}

viewModelScope.launch(Dispatchers.Default) {
currencyManager.baseCurrencyUpdatedFlow.collect {
reload()

viewState = ViewState.Success

emitState()
}
}
}

private suspend fun reload() {
Expand Down

0 comments on commit 072e15e

Please sign in to comment.