TP-22023-minor-code-revert (#5811)

This commit is contained in:
Apoorv Nigam
2023-03-27 12:40:14 +05:30
committed by GitHub Enterprise
parent fe3d6556d5
commit e7fc480622

View File

@@ -174,12 +174,15 @@ class GoldConversionWidgetLayout @JvmOverloads constructor(
if (charSequenceToString.toDouble() != info.actualAmount() &&
isAmountEditInProgress
) {
unselectChipsIfSelected()
updatePrice(charSequenceToString.toDouble().orZero())
}
} else {
unselectChipsIfSelected()
updatePrice(0.0)
}
} else {
unselectChipsIfSelected()
updatePrice(0.0)
}
if (charSequenceToString
@@ -206,10 +209,12 @@ class GoldConversionWidgetLayout @JvmOverloads constructor(
isWeightEditInProgress
) {
cbSellAmount.isChecked = false
unselectChipsIfSelected()
updateWeight(weight)
}
} else {
cbSellAmount.isChecked = false
unselectChipsIfSelected()
updateWeight(0.0)
}
}.launchIn(coroutineScope)
@@ -274,7 +279,6 @@ class GoldConversionWidgetLayout @JvmOverloads constructor(
}
private fun updatePrice(amount: Double) {
unselectChipsIfSelected()
info.setActualAmount(amount)
info.setActualWeight(
decimalFormatOfWeight(
@@ -304,7 +308,6 @@ class GoldConversionWidgetLayout @JvmOverloads constructor(
}
private fun updateWeight(weight: Double) {
unselectChipsIfSelected()
info.setActualWeight(weight)
val amount =
calculateAmount(