mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-07-01 22:20:57 +02:00
Save pair on all unit changes
This commit is contained in:
parent
4354d00652
commit
627ce5a785
@ -160,8 +160,8 @@ class ConverterViewModel @Inject constructor(
|
|||||||
_unitTo.update { allUnitsRepository.getCollectionByGroup(unit.group).first() }
|
_unitTo.update { allUnitsRepository.getCollectionByGroup(unit.group).first() }
|
||||||
}
|
}
|
||||||
incrementCounter(unit)
|
incrementCounter(unit)
|
||||||
updateCurrenciesRatesIfNeeded()
|
|
||||||
saveLatestPairOfUnits()
|
saveLatestPairOfUnits()
|
||||||
|
updateCurrenciesRatesIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -182,6 +182,7 @@ class ConverterViewModel @Inject constructor(
|
|||||||
_unitFrom
|
_unitFrom
|
||||||
.getAndUpdate { _unitTo.value }
|
.getAndUpdate { _unitTo.value }
|
||||||
.also { oldUnitFrom -> _unitTo.update { oldUnitFrom } }
|
.also { oldUnitFrom -> _unitTo.update { oldUnitFrom } }
|
||||||
|
saveLatestPairOfUnits()
|
||||||
updateCurrenciesRatesIfNeeded()
|
updateCurrenciesRatesIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user