diff --git a/lib/core/backup_service.dart b/lib/core/backup_service.dart index 999b67120..2c680db1b 100644 --- a/lib/core/backup_service.dart +++ b/lib/core/backup_service.dart @@ -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: diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index 9fc082ec4..ecc5baf8a 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -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) {