Skip to content

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

mobile: set privacy screen when app lock settings change

Ammar Ahmed143a38ade685
diff --git a/apps/mobile/app/components/dialogs/applock-password/index.tsx b/apps/mobile/app/components/dialogs/applock-password/index.tsx
index 64eba6949..8c6796ecc 100644
--- a/apps/mobile/app/components/dialogs/applock-password/index.tsx
+++ b/apps/mobile/app/components/dialogs/applock-password/index.tsx
@@ -327,6 +327,7 @@ export const AppLockPassword = () => {
SettingsService.getProperty("biometricsAuthEnabled") === false
) {
SettingsService.setProperty("appLockEnabled", false);
+ SettingsService.setPrivacyScreen(SettingsService.get());
ToastManager.show({
message: "App lock disabled",
type: "success"
diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx
index 53f429ff2..6c6913d83 100644
--- a/apps/mobile/app/screens/settings/settings-data.tsx
+++ b/apps/mobile/app/screens/settings/settings-data.tsx
@@ -849,6 +849,9 @@ export const settingsGroups: SettingSection[] = [
icon: "lock",
type: "switch",
property: "appLockEnabled",
+ onChange: () => {
+ SettingsService.setPrivacyScreen(SettingsService.get());
+ },
onVerify: async () => {
const verified = await verifyUserWithApplock();
if (!verified) return false;
diff --git a/apps/mobile/app/services/settings.ts b/apps/mobile/app/services/settings.ts
index 491741046..095b61c05 100644
--- a/apps/mobile/app/services/settings.ts
+++ b/apps/mobile/app/services/settings.ts
@@ -98,7 +98,7 @@ function init() {
}
function setPrivacyScreen(settings: SettingStore["settings"]) {
- if (settings.privacyScreen || canLockAppInBackground()) {
+ if (settings.privacyScreen || settings.appLockEnabled) {
if (Platform.OS === "android") {
NotesnookModule.setSecureMode(true);
} else {
@@ -226,7 +226,8 @@ export const SettingsService = {
resetSettings,
shouldLockAppOnEnterForeground,
canLockAppInBackground,
- appEnteredBackground
+ appEnteredBackground,
+ setPrivacyScreen
};
init();