Save pair on all unit changes

This commit is contained in:
sadellie 2023-07-20 22:12:33 +03:00
parent 4354d00652
commit 627ce5a785

View File

@ -160,8 +160,8 @@ class ConverterViewModel @Inject constructor(
_unitTo.update { allUnitsRepository.getCollectionByGroup(unit.group).first() }
}
incrementCounter(unit)
updateCurrenciesRatesIfNeeded()
saveLatestPairOfUnits()
updateCurrenciesRatesIfNeeded()
}
/**
@ -182,6 +182,7 @@ class ConverterViewModel @Inject constructor(
_unitFrom
.getAndUpdate { _unitTo.value }
.also { oldUnitFrom -> _unitTo.update { oldUnitFrom } }
saveLatestPairOfUnits()
updateCurrenciesRatesIfNeeded()
}