Skip to content

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

fix privacy mode & fingerprint on ios

ammarahm-ed1d0cb48c3420
diff --git a/apps/mobile/AppRootEvents.js b/apps/mobile/AppRootEvents.js
index 3633f5b78..dce94c670 100644
--- a/apps/mobile/AppRootEvents.js
+++ b/apps/mobile/AppRootEvents.js
@@ -82,22 +82,31 @@ async function reconnectSSE(connection) {
}
let prevState = null;
-
+let showingDialog = false;
const onAppStateChanged = async (state) => {
if (state === 'active') {
updateStatusBarColor();
- if (
- SettingsService.get().privacyScreen ||
- SettingsService.get().appLockMode === 'background'
- ) {
- enabled(false);
- if (prevState === 'background') {
- SplashScreen.show();
+ if (SettingsService.get().appLockMode === 'background') {
+ //enabled(false);
+ if (prevState === 'background' && !showingDialog) {
+ showingDialog = true;
+ prevState = 'active';
+ if (Platform.OS === 'android') {
+ SplashScreen.show();
+ } else {
+ eSendEvent('load_overlay', 'hide');
+ }
+
let result = await BiometricService.validateUser(
'Unlock to access your notes',
);
if (result) {
- SplashScreen.hide();
+ showingDialog = false;
+ if (Platform.OS === 'android') {
+ SplashScreen.hide();
+ } else {
+ eSendEvent('load_overlay', 'show');
+ }
} else {
RNExitApp.exitApp();
return;
diff --git a/apps/mobile/babel.config.js b/apps/mobile/babel.config.js
index 7c6341171..8bb68016c 100644
--- a/apps/mobile/babel.config.js
+++ b/apps/mobile/babel.config.js
@@ -1,6 +1,6 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
- "transform-remove-console"
+ //"transform-remove-console"
]
};
diff --git a/apps/mobile/src/components/AppLoader/index.js b/apps/mobile/src/components/AppLoader/index.js
index f9298a161..de737df91 100644
--- a/apps/mobile/src/components/AppLoader/index.js
+++ b/apps/mobile/src/components/AppLoader/index.js
@@ -10,9 +10,9 @@ import {
eUnSubscribeEvent,
} from '../../services/EventManager';
import {changeContainerScale, ContainerScale} from '../../utils/Animations';
-import { db } from '../../utils/DB';
+import {db} from '../../utils/DB';
import {eOpenSideMenu} from '../../utils/Events';
-import { sleep } from '../../utils/TimeUtils';
+import {sleep} from '../../utils/TimeUtils';
const scaleV = new Animated.Value(0.95);
const opacityV = new Animated.Value(1);
@@ -22,7 +22,18 @@ const AppLoader = ({onLoad}) => {
const [loading, setLoading] = useState(true);
const [opacity, setOpacity] = useState(true);
- const load = async () => {
+ const load = async (value) => {
+ if (value === 'hide') {
+ setLoading(true);
+ opacityV.setValue(1);
+ return;
+ }
+ if (value === 'show') {
+ opacityV.setValue(0)
+ setLoading(false);
+ return;
+ }
+
eSendEvent(eOpenSideMenu);
setOpacity(false);
await sleep(2);
@@ -81,11 +92,7 @@ const AppLoader = ({onLoad}) => {
flexDirection: 'row',
width: 100,
}}>
- <AnimatedProgress
- fill={colors.accent}
- current={4}
- total={4}
- />
+ <AnimatedProgress fill={colors.accent} current={4} total={4} />
</View>
</Animated.View>
</Animated.View>
diff --git a/apps/mobile/src/services/BiometricService.js b/apps/mobile/src/services/BiometricService.js
index 1281454fe..5752c7bae 100644
--- a/apps/mobile/src/services/BiometricService.js
+++ b/apps/mobile/src/services/BiometricService.js
@@ -93,7 +93,7 @@ async function validateUser(title, description) {
Platform.select({
ios: {
fallbackEnabled: true,
- description: description,
+ description: title,
},
android: {
title: title,