mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-20 06:08:34 +02:00
fix: fiat amount when sending all (#1516)
* fix: fiat amount when sending all * possible fix for pending txs workaroudn update * also for wow
This commit is contained in:
@@ -332,7 +332,9 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
|
||||
width: prefixIconWidth,
|
||||
height: prefixIconHeight,
|
||||
child: InkWell(
|
||||
onTap: () async => output.setSendAll(),
|
||||
onTap: () async {
|
||||
output.setSendAll(sendViewModel.balance);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
|
||||
@@ -38,6 +38,7 @@ abstract class OutputBase with Store {
|
||||
key = UniqueKey(),
|
||||
sendAll = false,
|
||||
cryptoAmount = '',
|
||||
cryptoFullBalance = '',
|
||||
fiatAmount = '',
|
||||
address = '',
|
||||
note = '',
|
||||
@@ -54,6 +55,9 @@ abstract class OutputBase with Store {
|
||||
@observable
|
||||
String cryptoAmount;
|
||||
|
||||
@observable
|
||||
String cryptoFullBalance;
|
||||
|
||||
@observable
|
||||
String address;
|
||||
|
||||
@@ -202,9 +206,11 @@ abstract class OutputBase with Store {
|
||||
final SettingsStore _settingsStore;
|
||||
final FiatConversionStore _fiatConversationStore;
|
||||
final NumberFormat _cryptoNumberFormat;
|
||||
|
||||
@action
|
||||
void setSendAll() => sendAll = true;
|
||||
void setSendAll(String fullBalance) {
|
||||
cryptoFullBalance = fullBalance;
|
||||
sendAll = true;
|
||||
}
|
||||
|
||||
@action
|
||||
void reset() {
|
||||
@@ -243,7 +249,7 @@ abstract class OutputBase with Store {
|
||||
try {
|
||||
final fiat = calculateFiatAmount(
|
||||
price: _fiatConversationStore.prices[cryptoCurrencyHandler()]!,
|
||||
cryptoAmount: cryptoAmount.replaceAll(',', '.'));
|
||||
cryptoAmount: sendAll ? cryptoFullBalance.replaceAll(",", ".") : cryptoAmount.replaceAll(',', '.'));
|
||||
if (fiatAmount != fiat) {
|
||||
fiatAmount = fiat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user