mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-29 06:38:45 +01: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:
@@ -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