diff --git a/apps/mobile/app/components/app-lock-overlay/index.tsx b/apps/mobile/app/components/app-lock-overlay/index.tsx
index a066357f8..4a15791bf 100644
--- a/apps/mobile/app/components/app-lock-overlay/index.tsx
+++ b/apps/mobile/app/components/app-lock-overlay/index.tsx
@@ -103,6 +103,8 @@ const AppLockedOverlay = () => {
)
return;
+ biometricUnlockAwaitingUserInput.current = true;
+
if (Platform.OS === "android") {
const activityName = await NotesnookModule.getActivityName();
if (activityName !== "MainActivity") return;
@@ -118,10 +120,11 @@ const AppLockedOverlay = () => {
enabled(false);
password.current = undefined;
}
+ biometricUnlockAwaitingUserInput.current = false;
setTimeout(() => {
- biometricUnlockAwaitingUserInput.current = false;
+ if (biometricUnlockAwaitingUserInput.current) return;
useSettingStore.getState().setRequestBiometrics(false);
- }, 1);
+ }, 500);
}, [biometricsAuthEnabled, lockApp]);
const onSubmit = async () => {
@@ -156,7 +159,11 @@ const AppLockedOverlay = () => {
useUserStore.getState().disableAppLockRequests
)
return;
- if (appLocked && appState === "active") {
+ if (
+ appLocked &&
+ appState === "active" &&
+ !useSettingStore.getState().requestBiometrics
+ ) {
biometricUnlockAwaitingUserInput.current = true;
onUnlockAppRequested();
}
diff --git a/apps/mobile/app/hooks/use-app-events.tsx b/apps/mobile/app/hooks/use-app-events.tsx
index a64368f0c..c62eb7120 100644
--- a/apps/mobile/app/hooks/use-app-events.tsx
+++ b/apps/mobile/app/hooks/use-app-events.tsx
@@ -485,7 +485,6 @@ export const useAppEvents = () => {
const onAppStateChanged = async (state: AppStateStatus) => {
if (state === "active") {
if (SettingsService.shouldLockAppOnEnterForeground()) {
- console.log("Locked app on enter foreground");
useUserStore.getState().lockApp(true);
}
@@ -497,12 +496,7 @@ export const useAppEvents = () => {
) {
enabled(false);
}
- if (SettingsService.canLockAppInBackground()) {
- if (useSettingStore.getState().requestBiometrics) {
- useSettingStore.getState().setRequestBiometrics(false);
- return;
- }
- }
+
checkAutoBackup();
await reconnectSSE();
await checkForShareExtensionLaunchedInBackground();
@@ -543,10 +537,11 @@ export const useAppEvents = () => {
}
}
if (
- SettingsService.get().privacyScreen ||
- SettingsService.canLockAppInBackground()
+ (SettingsService.get().privacyScreen ||
+ SettingsService.canLockAppInBackground()) &&
+ !useSettingStore.getState().requestBiometrics
) {
- !useSettingStore.getState().requestBiometrics ? enabled(true) : null;
+ enabled(true);
}
}
};
diff --git a/apps/mobile/app/screens/settings/picker/index.tsx b/apps/mobile/app/screens/settings/picker/index.tsx
index ac18da566..2d975d840 100644
--- a/apps/mobile/app/screens/settings/picker/index.tsx
+++ b/apps/mobile/app/screens/settings/picker/index.tsx
@@ -18,7 +18,7 @@ along with this program. If not, see .
*/
import React, { useRef, useState } from "react";
-import { View } from "react-native";
+import { TouchableHighlight, View } from "react-native";
import Menu, { MenuItem } from "react-native-reanimated-material-menu";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { PressableButton } from "../../../components/ui/pressable";
@@ -126,6 +126,7 @@ export function SettingsPicker({
}
>
+
{options.map((item) => (