mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 17:15:48 +00:00
Bridge: clear entered amount after a successful origin-chain submit
The origin transfer already happened once submitBridgeTransfer's dispatch result comes back success, so the amount input still holding the just-spent value made the live balance-vs-amount check flag a false "insufficient balance" error right next to the real success/waiting state - reading as if the transfer failed or was retried, when it had already gone through once. Clearing the field via the existing fillAmountEvent mechanism removes the stale comparison instead of adding new state.
This commit is contained in:
+7
@@ -322,6 +322,13 @@ class BridgeViewModel(
|
||||
|
||||
submissionResult.fold(
|
||||
onSuccess = {
|
||||
// The origin transfer already happened - clear the stale entered amount so the
|
||||
// live balance-vs-amount check (updateInsufficientBalanceState/updateButtonState)
|
||||
// doesn't flag the now-lower post-transfer balance against an amount that was
|
||||
// already spent. Without this, a real successful transfer and a false "insufficient
|
||||
// balance" error appear side by side, which reads as if something failed twice.
|
||||
_fillAmountEvent.postValue(Event("0"))
|
||||
|
||||
// Real on-chain dispatch confirmed on the origin chain - now (and only now) wait
|
||||
// for the bridge to actually credit the destination.
|
||||
observeDepositCompletion(destChainId, destAssetId, amount)
|
||||
|
||||
Reference in New Issue
Block a user