NTP-969 | gold widget bug fix (#11833)

This commit is contained in:
Apoorv Nigam
2024-07-18 18:40:52 +05:30
committed by GitHub
parent 5ee7e75ac2
commit 40e59be4e9

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2022-2023 by Navi Technologies Limited
* * Copyright © 2022-2024 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -831,9 +831,11 @@ constructor(
}
}
fun updateAmountAndWeight(info: GoldConversionWidgetInfo) {
fun updateAmountAndWeight(info: GoldConversionWidgetInfo, toResetError: Boolean = true) {
this.info = info
resetErrorState()
if (toResetError) {
resetErrorState()
}
binding.apply {
val amount = info.actualAmount() ?: 0.0
if (amount > 0.0) {
@@ -1024,6 +1026,7 @@ constructor(
fun setError() {
setErrorBackgroundForAmountLayout()
setActionButtonState()
updateAmountAndWeight(info, false)
binding.clError.isVisible = true
binding.clRewardInfo.isVisible = false
widgetCallback.widgetAnalytics(GenericAnalyticsData(eventName = INPUT_ERROR_EVENT))