@ -34,6 +34,8 @@ abstract class SettingsStoreBase with Store {
required BalanceDisplayMode initialBalanceDisplayMode ,
required bool initialSaveRecipientAddress ,
required bool initialAppSecure ,
required bool initialDisableBuy ,
required bool initialDisableSell ,
required FiatApiMode initialFiatMode ,
required bool initialAllowBiometricalAuthentication ,
required ExchangeApiMode initialExchangeStatus ,
@ -57,6 +59,8 @@ abstract class SettingsStoreBase with Store {
balanceDisplayMode = initialBalanceDisplayMode ,
shouldSaveRecipientAddress = initialSaveRecipientAddress ,
isAppSecure = initialAppSecure ,
disableBuy = initialDisableBuy ,
disableSell = initialDisableSell ,
fiatApiMode = initialFiatMode ,
allowBiometricalAuthentication = initialAllowBiometricalAuthentication ,
shouldShowMarketPlaceInDashboard = initialShouldShowMarketPlaceInDashboard ,
@ -130,6 +134,16 @@ abstract class SettingsStoreBase with Store {
}
} ) ;
reaction (
( _ ) = > disableBuy ,
( bool disableBuy ) = > sharedPreferences . setBool (
PreferencesKey . disableBuyKey , disableBuy ) ) ;
reaction (
( _ ) = > disableSell ,
( bool disableSell ) = > sharedPreferences . setBool (
PreferencesKey . disableSellKey , disableSell ) ) ;
if ( Platform . isAndroid ) {
setIsAppSecureNative ( isAppSecure ) ;
}
@ -217,6 +231,12 @@ abstract class SettingsStoreBase with Store {
@ observable
bool isAppSecure ;
@ observable
bool disableBuy ;
@ observable
bool disableSell ;
@ observable
bool allowBiometricalAuthentication ;
@ -309,6 +329,10 @@ abstract class SettingsStoreBase with Store {
sharedPreferences . getBool ( PreferencesKey . shouldSaveRecipientAddressKey ) ? ? false ;
final isAppSecure =
sharedPreferences . getBool ( PreferencesKey . isAppSecureKey ) ? ? false ;
final disableBuy =
sharedPreferences . getBool ( PreferencesKey . disableBuyKey ) ? ? false ;
final disableSell =
sharedPreferences . getBool ( PreferencesKey . disableSellKey ) ? ? false ;
final currentFiatApiMode = FiatApiMode . deserialize (
raw: sharedPreferences
. getInt ( PreferencesKey . currentFiatApiModeKey ) ? ? FiatApiMode . enabled . raw ) ;
@ -388,6 +412,8 @@ abstract class SettingsStoreBase with Store {
initialBalanceDisplayMode: currentBalanceDisplayMode ,
initialSaveRecipientAddress: shouldSaveRecipientAddress ,
initialAppSecure: isAppSecure ,
initialDisableBuy: disableBuy ,
initialDisableSell: disableSell ,
initialFiatMode: currentFiatApiMode ,
initialAllowBiometricalAuthentication: allowBiometricalAuthentication ,
initialExchangeStatus: exchangeStatus ,
@ -435,6 +461,10 @@ abstract class SettingsStoreBase with Store {
sharedPreferences . getBool ( PreferencesKey . shouldSaveRecipientAddressKey ) ? ? shouldSaveRecipientAddress ;
isAppSecure =
sharedPreferences . getBool ( PreferencesKey . isAppSecureKey ) ? ? isAppSecure ;
disableBuy =
sharedPreferences . getBool ( PreferencesKey . disableBuyKey ) ? ? disableBuy ;
disableSell =
sharedPreferences . getBool ( PreferencesKey . disableSellKey ) ? ? disableSell ;
allowBiometricalAuthentication = sharedPreferences
. getBool ( PreferencesKey . allowBiometricalAuthenticationKey ) ? ?
allowBiometricalAuthentication ;