mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
Merge branch 'CW-118-Allow-disabling-of-fiat' of https://github.com/cake-tech/cake_wallet into CW-118-Allow-disabling-of-fiat
This commit is contained in:
@@ -72,7 +72,7 @@ abstract class BalanceViewModelBase with Store {
|
||||
BalanceDisplayMode get savedDisplayMode => settingsStore.balanceDisplayMode;
|
||||
|
||||
@computed
|
||||
bool get disableFiat => settingsStore.fiatApiMode == FiatApiMode.disabled;
|
||||
bool get isFiatDisabled => settingsStore.fiatApiMode == FiatApiMode.disabled;
|
||||
|
||||
@computed
|
||||
String get asset {
|
||||
@@ -183,8 +183,8 @@ abstract class BalanceViewModelBase with Store {
|
||||
return MapEntry(key, BalanceRecord(
|
||||
availableBalance: '---',
|
||||
additionalBalance: '---',
|
||||
fiatAdditionalBalance: disableFiat ? '' : '---',
|
||||
fiatAvailableBalance: disableFiat ? '' : '---',
|
||||
fiatAdditionalBalance: isFiatDisabled ? '' : '---',
|
||||
fiatAvailableBalance: isFiatDisabled ? '' : '---',
|
||||
asset: key,
|
||||
formattedAssetTitle: _formatterAsset(key)));
|
||||
}
|
||||
@@ -195,13 +195,13 @@ abstract class BalanceViewModelBase with Store {
|
||||
// throw Exception('Price is null for: $key');
|
||||
// }
|
||||
|
||||
final additionalFiatBalance = disableFiat ? '' : (fiatCurrency.toString()
|
||||
final additionalFiatBalance = isFiatDisabled ? '' : (fiatCurrency.toString()
|
||||
+ ' '
|
||||
+ _getFiatBalance(
|
||||
price: price,
|
||||
cryptoAmount: value.formattedAdditionalBalance));
|
||||
|
||||
final availableFiatBalance = disableFiat ? '' : (fiatCurrency.toString()
|
||||
final availableFiatBalance = isFiatDisabled ? '' : (fiatCurrency.toString()
|
||||
+ ' '
|
||||
+ _getFiatBalance(
|
||||
price: price,
|
||||
|
||||
@@ -74,13 +74,13 @@ abstract class ExchangeTradeViewModelBase with Store {
|
||||
|
||||
@computed
|
||||
String get pendingTransactionFiatAmountValueFormatted =>
|
||||
sendViewModel.balanceViewModel.disableFiat
|
||||
sendViewModel.isFiatDisabled
|
||||
? '' : sendViewModel.pendingTransactionFiatAmount
|
||||
+ ' ' + sendViewModel.fiat.title;
|
||||
|
||||
@computed
|
||||
String get pendingTransactionFeeFiatAmountFormatted =>
|
||||
sendViewModel.balanceViewModel.disableFiat
|
||||
sendViewModel.isFiatDisabled
|
||||
? '' : sendViewModel.pendingTransactionFeeFiatAmount
|
||||
+ ' ' + sendViewModel.fiat.title;
|
||||
|
||||
|
||||
@@ -142,14 +142,17 @@ abstract class SendViewModelBase with Store {
|
||||
@computed
|
||||
String get balance => balanceViewModel.availableBalance;
|
||||
|
||||
@computed
|
||||
bool get isFiatDisabled => balanceViewModel.isFiatDisabled;
|
||||
|
||||
@computed
|
||||
String get pendingTransactionFiatAmountFormatted =>
|
||||
balanceViewModel.disableFiat ? '' : pendingTransactionFiatAmount +
|
||||
isFiatDisabled ? '' : pendingTransactionFiatAmount +
|
||||
' ' + fiat.title;
|
||||
|
||||
@computed
|
||||
String get pendingTransactionFeeFiatAmountFormatted =>
|
||||
balanceViewModel.disableFiat ? '' : pendingTransactionFeeFiatAmount +
|
||||
isFiatDisabled ? '' : pendingTransactionFeeFiatAmount +
|
||||
' ' + fiat.title;
|
||||
|
||||
@computed
|
||||
|
||||
@@ -18,7 +18,7 @@ abstract class PrivacySettingsViewModelBase with Store {
|
||||
bool get shouldSaveRecipientAddress => _settingsStore.shouldSaveRecipientAddress;
|
||||
|
||||
@computed
|
||||
bool get fiatApiMode => _settingsStore.fiatApiMode == FiatApiMode.disabled;
|
||||
bool get isFiatDisabled => _settingsStore.fiatApiMode == FiatApiMode.disabled;
|
||||
|
||||
@action
|
||||
void setShouldSaveRecipientAddress(bool value) => _settingsStore.shouldSaveRecipientAddress = value;
|
||||
|
||||
Reference in New Issue
Block a user