Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix settings value not updated

ammarahm-ed9fe13c41dd79
diff --git a/apps/mobile/AppRootEvents.js b/apps/mobile/AppRootEvents.js
index dce94c670..6b677812b 100644
--- a/apps/mobile/AppRootEvents.js
+++ b/apps/mobile/AppRootEvents.js
@@ -86,8 +86,14 @@ let showingDialog = false;
const onAppStateChanged = async (state) => {
if (state === 'active') {
updateStatusBarColor();
+ if (
+ SettingsService.get().appLockMode !== 'background' &&
+ !SettingsService.get().privacyScreen
+ ) {
+ enabled(false);
+ }
+
if (SettingsService.get().appLockMode === 'background') {
- //enabled(false);
if (prevState === 'background' && !showingDialog) {
showingDialog = true;
prevState = 'active';
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index af66f85e4..a6b9806e1 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -1100,7 +1100,7 @@ const SettingsPrivacyAndSecurity = () => {
settings.appLockMode === item.value ? 'accent' : 'transparent'
}
onPress={() => {
- setSetting(settings, 'appLockMode', item.value);
+ SettingsService.set('appLockMode',item.value)
}}
customStyle={{
justifyContent: 'flex-start',
@@ -1151,7 +1151,8 @@ const SettingsPrivacyAndSecurity = () => {
Platform.OS === 'android'
? AndroidModule.setSecureMode(!settings.privacyScreen)
: enabled(true);
- setSetting(settings, 'privacyScreen', !settings.privacyScreen);
+
+ SettingsService.set('privacyScreen', !settings.privacyScreen);
}}
maxWidth="90%"
customComponent={