performance: put smaller data in db

This commit is contained in:
ammarahm-ed
2020-01-13 14:46:12 +05:00
parent 32af5b3b1b
commit 9e651ff106
3 changed files with 6 additions and 6 deletions

View File

@@ -212,10 +212,10 @@ export const ActionSheetComponent = ({
icon: 'moon',
func: () => {
if (!colors.night) {
AsyncStorage.setItem('theme', JSON.stringify(COLOR_SCHEME_DARK));
AsyncStorage.setItem('theme', JSON.stringify({night: true}));
changeColorScheme(COLOR_SCHEME_DARK);
} else {
AsyncStorage.setItem('theme', JSON.stringify(COLOR_SCHEME_LIGHT));
AsyncStorage.setItem('theme', JSON.stringify({night: false}));
changeColorScheme(COLOR_SCHEME_LIGHT);
}
},

View File

@@ -61,10 +61,10 @@ export const Menu = ({close = () => {}, hide, update = () => {}}) => {
icon: 'moon',
func: () => {
if (!colors.night) {
AsyncStorage.setItem('theme', JSON.stringify(COLOR_SCHEME_DARK));
AsyncStorage.setItem('theme', JSON.stringify({night: true}));
changeColorScheme(COLOR_SCHEME_DARK);
} else {
AsyncStorage.setItem('theme', JSON.stringify(COLOR_SCHEME_LIGHT));
AsyncStorage.setItem('theme', JSON.stringify({night: false}));
changeColorScheme(COLOR_SCHEME_LIGHT);
}

View File

@@ -109,13 +109,13 @@ export const Settings = ({navigation}) => {
if (!colors.night) {
AsyncStorage.setItem(
'theme',
JSON.stringify(COLOR_SCHEME_DARK),
JSON.stringify({night: true}),
);
changeColorScheme(COLOR_SCHEME_DARK);
} else {
AsyncStorage.setItem(
'theme',
JSON.stringify(COLOR_SCHEME_LIGHT),
JSON.stringify({night: false}),
);
changeColorScheme(COLOR_SCHEME_LIGHT);