mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-28 06:28:41 +01:00
add Disable fiat mode
This commit is contained in:
@@ -29,6 +29,7 @@ abstract class SettingsStoreBase with Store {
|
||||
required FiatCurrency initialFiatCurrency,
|
||||
required BalanceDisplayMode initialBalanceDisplayMode,
|
||||
required bool initialSaveRecipientAddress,
|
||||
required bool initialDisableFiat,
|
||||
required bool initialAllowBiometricalAuthentication,
|
||||
required ThemeBase initialTheme,
|
||||
required int initialPinLength,
|
||||
@@ -46,6 +47,7 @@ abstract class SettingsStoreBase with Store {
|
||||
fiatCurrency = initialFiatCurrency,
|
||||
balanceDisplayMode = initialBalanceDisplayMode,
|
||||
shouldSaveRecipientAddress = initialSaveRecipientAddress,
|
||||
shouldDisableFiat = initialDisableFiat,
|
||||
allowBiometricalAuthentication = initialAllowBiometricalAuthentication,
|
||||
currentTheme = initialTheme,
|
||||
pinCodeLength = initialPinLength,
|
||||
@@ -87,6 +89,12 @@ abstract class SettingsStoreBase with Store {
|
||||
PreferencesKey.shouldSaveRecipientAddressKey,
|
||||
shouldSaveRecipientAddress));
|
||||
|
||||
reaction(
|
||||
(_) => shouldDisableFiat,
|
||||
(bool shouldDisableFiat) => sharedPreferences.setBool(
|
||||
PreferencesKey.shouldDisableFiatKey,
|
||||
shouldDisableFiat));
|
||||
|
||||
reaction(
|
||||
(_) => currentTheme,
|
||||
(ThemeBase theme) =>
|
||||
@@ -140,6 +148,9 @@ abstract class SettingsStoreBase with Store {
|
||||
@observable
|
||||
bool shouldSaveRecipientAddress;
|
||||
|
||||
@observable
|
||||
bool shouldDisableFiat;
|
||||
|
||||
@observable
|
||||
bool allowBiometricalAuthentication;
|
||||
|
||||
@@ -218,6 +229,8 @@ abstract class SettingsStoreBase with Store {
|
||||
// FIX-ME: Check for which default value we should have here
|
||||
final shouldSaveRecipientAddress =
|
||||
sharedPreferences.getBool(PreferencesKey.shouldSaveRecipientAddressKey) ?? false;
|
||||
final shouldDisableFiat =
|
||||
sharedPreferences.getBool(PreferencesKey.shouldDisableFiatKey) ?? false;
|
||||
final allowBiometricalAuthentication = sharedPreferences
|
||||
.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ??
|
||||
false;
|
||||
@@ -283,6 +296,7 @@ abstract class SettingsStoreBase with Store {
|
||||
initialFiatCurrency: currentFiatCurrency,
|
||||
initialBalanceDisplayMode: currentBalanceDisplayMode,
|
||||
initialSaveRecipientAddress: shouldSaveRecipientAddress,
|
||||
initialDisableFiat: shouldDisableFiat,
|
||||
initialAllowBiometricalAuthentication: allowBiometricalAuthentication,
|
||||
initialTheme: savedTheme,
|
||||
actionlistDisplayMode: actionListDisplayMode,
|
||||
|
||||
Reference in New Issue
Block a user