CLear input when switching between converter modes.

This commit is contained in:
Sad Ellie 2023-01-04 16:15:51 +04:00
parent 9d6de84323
commit 28935f31e0

View File

@ -322,7 +322,7 @@ class MainViewModel @Inject constructor(
*/ */
fun updateUnitFrom(unit: AbstractUnit) { fun updateUnitFrom(unit: AbstractUnit) {
// We change from something to base converter or the other way around // We change from something to base converter or the other way around
if ((_unitFrom.value?.group != UnitGroup.NUMBER_BASE) xor (unit.group == UnitGroup.NUMBER_BASE)) { if ((_unitFrom.value?.group == UnitGroup.NUMBER_BASE) xor (unit.group == UnitGroup.NUMBER_BASE)) {
_calculated.update { null } _calculated.update { null }
clearInput() clearInput()
} }