mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
Added backsupport for old saved themes
This commit is contained in:
parent
89c240091b
commit
bd2bab997f
2 changed files with 10 additions and 3 deletions
|
@ -10,6 +10,7 @@ class PreferencesKey {
|
|||
static const allowBiometricalAuthenticationKey =
|
||||
'allow_biometrical_authentication';
|
||||
static const currentTheme = 'current_theme';
|
||||
static const isDarkThemeLegacy = 'dark_theme';
|
||||
static const displayActionListModeKey = 'display_list_mode';
|
||||
static const currentPinLength = 'current_pin_length';
|
||||
static const currentLanguageCode = 'language_code';
|
||||
|
|
|
@ -66,8 +66,8 @@ abstract class SettingsStoreBase with Store {
|
|||
|
||||
reaction(
|
||||
(_) => currentTheme,
|
||||
(ThemeBase theme) => sharedPreferences.setInt(
|
||||
PreferencesKey.currentTheme, theme.raw));
|
||||
(ThemeBase theme) =>
|
||||
sharedPreferences.setInt(PreferencesKey.currentTheme, theme.raw));
|
||||
|
||||
reaction(
|
||||
(_) => allowBiometricalAuthentication,
|
||||
|
@ -152,8 +152,14 @@ abstract class SettingsStoreBase with Store {
|
|||
final allowBiometricalAuthentication = sharedPreferences
|
||||
.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ??
|
||||
false;
|
||||
final legacyTheme =
|
||||
sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy)
|
||||
? ThemeType.dark.index
|
||||
: ThemeType.bright.index;
|
||||
final savedTheme = ThemeList.deserialize(
|
||||
raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ?? 0);
|
||||
raw: sharedPreferences.getInt(PreferencesKey.currentTheme) ??
|
||||
legacyTheme ??
|
||||
0);
|
||||
final actionListDisplayMode = ObservableList<ActionListDisplayMode>();
|
||||
actionListDisplayMode.addAll(deserializeActionlistDisplayModes(
|
||||
sharedPreferences.getInt(PreferencesKey.displayActionListModeKey) ??
|
||||
|
|
Loading…
Reference in a new issue