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
mobile: fix app lock hides login page on enter background
Ammar Ahmed7e345303fe79
diff --git a/apps/mobile/app/components/auth/auth-modal.js b/apps/mobile/app/components/auth/auth-modal.jsindex 2f42ddca7..39c5a0e9d 100644--- a/apps/mobile/app/components/auth/auth-modal.js+++ b/apps/mobile/app/components/auth/auth-modal.js@@ -17,14 +17,16 @@ You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/+import { useThemeColors } from "@notesnook/theme";import React, { useEffect, useRef, useState } from "react";import { Platform, View } from "react-native";+import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";import {eSubscribeEvent,eUnSubscribeEvent} from "../../services/event-manager";-import { useThemeColors } from "@notesnook/theme";+import { useUserStore } from "../../stores/use-user-store";import { eCloseLoginDialog, eOpenLoginDialog } from "../../utils/events";import { sleep } from "../../utils/time";import BaseDialog from "../dialog/base-dialog";@@ -34,7 +36,6 @@ import { IconButton } from "../ui/icon-button";import { hideAuth, initialAuthMode } from "./common";import { Login } from "./login";import { Signup } from "./signup";-import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";export const AuthMode = {login: 0,@@ -68,6 +69,9 @@ const AuthModal = () => {}const close = () => {+ useUserStore.setState({+ disableAppLockRequests: false+ });actionSheetRef.current?.hide();setCurrentAuthMode(AuthMode.login);setVisible(false);@@ -77,6 +81,11 @@ const AuthModal = () => {<BaseDialogoverlayOpacity={0}statusBarTranslucent={false}+ onShow={() => {+ useUserStore.setState({+ disableAppLockRequests: true+ });+ }}onRequestClose={currentAuthMode !== AuthMode.welcomeSignup && close}visible={true}onClose={close}diff --git a/apps/mobile/app/components/dialog/base-dialog.js b/apps/mobile/app/components/dialog/base-dialog.jsindex 0b0f2ff2f..25af87313 100644--- a/apps/mobile/app/components/dialog/base-dialog.js+++ b/apps/mobile/app/components/dialog/base-dialog.js@@ -66,6 +66,7 @@ const BaseDialog = ({}, []);useEffect(() => {+ if (useUserStore.getState().disableAppLockRequests) return;if (SettingsService.get().appLockMode === "background") {if (appState === "background") {setIntervalVisible(false);diff --git a/apps/mobile/app/components/ui/sheet/index.js b/apps/mobile/app/components/ui/sheet/index.jsindex 08bd7d948..ae215405b 100644--- a/apps/mobile/app/components/ui/sheet/index.js+++ b/apps/mobile/app/components/ui/sheet/index.js@@ -85,6 +85,7 @@ const SheetWrapper = ({};useEffect(() => {+ if (useUserStore.getState().disableAppLockRequests) return;if (SettingsService.get().appLockMode === "background") {if (appState === "background") {const ref = fwdRef || localRef;