From 71262f124b2386078dbb2dc2f64c2060f0490132 Mon Sep 17 00:00:00 2001 From: Maksym Rachytskyy Date: Wed, 4 Sep 2024 10:47:19 +0300 Subject: [PATCH] Fix `Send All` button logic, while sending ccd's (#412) ## Purpose The Send All button currently does not trigger the logic chain needed to update its state. ## Changes Added functionality to update the Send button state after the amount to send value is changed. --- .../AccountsView/SendFunds/SendFund/SendFundPresenter.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ConcordiumWallet/Views/AccountsView/SendFunds/SendFund/SendFundPresenter.swift b/ConcordiumWallet/Views/AccountsView/SendFunds/SendFund/SendFundPresenter.swift index a8913316..45124d3d 100644 --- a/ConcordiumWallet/Views/AccountsView/SendFunds/SendFund/SendFundPresenter.swift +++ b/ConcordiumWallet/Views/AccountsView/SendFunds/SendFund/SendFundPresenter.swift @@ -580,6 +580,10 @@ class SendFundPresenter: SendFundPresenterProtocol { totalAmount = (GTU(intValue: disposalAmount) - cost).displayValue() } self.viewModel.sendAllAmount = totalAmount + + let newAmount = SendFundsAmount.ccd(token: GTU(intValue: disposalAmount) - cost) + self.viewModel.enteredAmount = .success(newAmount) + self.cost = cost self.energy = value.energy let feeMessage = "sendFund.feeMessage".localized + cost.displayValue()