- Add disable exchange to the export/import flow

- Save changes to Disable Exchange
This commit is contained in:
OmarHatem 2022-12-07 17:14:27 +02:00
parent c235df8935
commit 8b333f2925
2 changed files with 12 additions and 0 deletions

View file

@ -216,6 +216,7 @@ class BackupService {
final displayActionListMode = data[PreferencesKey.displayActionListModeKey] as int?;
final currentPinLength = data[PreferencesKey.currentPinLength] as int?;
final currentTheme = data[PreferencesKey.currentTheme] as int?;
final disableExchange = data[PreferencesKey.disableExchangeKey] as bool?;
final currentDefaultSettingsMigrationVersion = data[PreferencesKey.currentDefaultSettingsMigrationVersion] as int?;
final moneroTransactionPriority = data[PreferencesKey.moneroTransactionPriority] as int?;
final bitcoinTransactionPriority = data[PreferencesKey.bitcoinTransactionPriority] as int?;
@ -274,6 +275,10 @@ class BackupService {
await _sharedPreferences.setInt(
PreferencesKey.currentTheme, currentTheme);
if (disableExchange != null)
await _sharedPreferences.setBool(
PreferencesKey.disableExchangeKey, disableExchange);
if (currentDefaultSettingsMigrationVersion != null)
await _sharedPreferences.setInt(
PreferencesKey.currentDefaultSettingsMigrationVersion,
@ -421,6 +426,8 @@ class BackupService {
_sharedPreferences.getInt(PreferencesKey.displayActionListModeKey),
PreferencesKey.currentTheme:
_sharedPreferences.getInt(PreferencesKey.currentTheme),
PreferencesKey.disableExchangeKey:
_sharedPreferences.getBool(PreferencesKey.disableExchangeKey),
PreferencesKey.currentDefaultSettingsMigrationVersion: _sharedPreferences
.getInt(PreferencesKey.currentDefaultSettingsMigrationVersion),
PreferencesKey.bitcoinTransactionPriority:

View file

@ -114,6 +114,11 @@ abstract class SettingsStoreBase with Store {
(BalanceDisplayMode mode) => sharedPreferences.setInt(
PreferencesKey.currentBalanceDisplayModeKey, mode.serialize()));
reaction(
(_) => disableExchange,
(bool disableExchange) => sharedPreferences.setBool(
PreferencesKey.disableExchangeKey, disableExchange));
this
.nodes
.observe((change) {