Skip to content

Commit

Permalink
[#3921] Update observed persisted values only inside observation block
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Sep 14, 2024
1 parent 0ec0665 commit 0182cea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class CalculatorViewModel(
.distinctUntilChanged()
.onEach {
Logger.d { "CalculatorViewModel observeBase $it" }
calculationStorage.currentBase = it
currentBaseChanged(it)
}
.launchIn(viewModelScope)
Expand Down Expand Up @@ -173,7 +174,6 @@ class CalculatorViewModel(
private fun currentBaseChanged(newBase: String) =
viewModelScope.launch {
data.conversion = null
calculationStorage.currentBase = newBase
val symbol = currencyDataSource.getCurrencyByCode(newBase)?.symbol.orEmpty()
setState {
copy(
Expand Down

0 comments on commit 0182cea

Please sign in to comment.