A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix applock interfere with vault unlocking
ammarahm-ed75e64719986a
diff --git a/apps/mobile/src/components/launcher/index.js b/apps/mobile/src/components/launcher/index.jsindex bfd4775f9..1dce27284 100644--- a/apps/mobile/src/components/launcher/index.js+++ b/apps/mobile/src/components/launcher/index.js@@ -35,6 +35,7 @@ import { SvgView } from '../ui/svg';import Heading from '../ui/typography/heading';import Paragraph from '../ui/typography/paragraph';import { Walkthrough } from '../walkthroughs';+import { useAppState } from '../../utils/hooks/use-app-state';const Launcher = React.memo(() => {@@ -45,6 +46,7 @@ const Launcher = React.memo(const verifyUser = useUserStore(state => state.verifyUser);const setVerifyUser = useUserStore(state => state.setVerifyUser);const deviceMode = useSettingStore(state => state.deviceMode);+ const appState = useAppState();const passwordInputRef = useRef();const password = useRef();const introCompleted = useSettingStore(state => state.settings.introCompleted);@@ -220,12 +222,15 @@ const Launcher = React.memo(};useEffect(() => {- if (verifyUser) {- onUnlockBiometrics();- }init();}, [verifyUser]);+ useEffect(() => {+ if (verifyUser && appState === 'active') {+ onUnlockBiometrics();+ }+ }, [appState]);+const onSubmit = async () => {if (!password.current) return;try {diff --git a/apps/mobile/src/utils/hooks/useAppEvents.js b/apps/mobile/src/utils/hooks/useAppEvents.jsindex 1c3c81ced..aef41a1a1 100644--- a/apps/mobile/src/utils/hooks/useAppEvents.js+++ b/apps/mobile/src/utils/hooks/useAppEvents.js@@ -328,19 +328,11 @@ export const useAppEvents = () => {useSettingStore.getState().setRequestBiometrics(false);return;}- if (refValues.current?.prevState === 'background') {- refValues.current.prevState = 'active';- useUserStore.getState().setVerifyUser(true);- let result = await BiometricService.validateUser('Unlock to access your notes');- if (result) {- useUserStore.getState().setVerifyUser(false);- enabled(false);- }- }}+refValues.current.prevState = 'active';- await reconnectSSE();+ await reconnectSSE();await checkIntentState();MMKV.removeItem('appState');let user = await db.user.getUser();@@ -363,9 +355,14 @@ export const useAppEvents = () => {if (SettingsService.get().privacyScreen ||SettingsService.get().appLockMode === 'background'+ ) {+ !useSettingStore.getState().requestBiometrics ? enabled(true) : null;+ }+ if (+ SettingsService.get().appLockMode === 'background' &&+ !useSettingStore.getState().requestBiometrics) {useUserStore.getState().setVerifyUser(true);- enabled(true);}}};