From a1a10a6c5565724183d4b49caa2962dcb103662c Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 10 Feb 2023 16:12:14 +0000 Subject: [PATCH] Android: Fixes #7691: Sharing file to Joplin does not work --- .../components/biometrics/BiometricPopup.tsx | 17 ++++++++++++++++- packages/app-mobile/root.tsx | 17 ++++++++++++----- packages/lib/reducer.ts | 6 ++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/packages/app-mobile/components/biometrics/BiometricPopup.tsx b/packages/app-mobile/components/biometrics/BiometricPopup.tsx index 5ed53099f..09fef990e 100644 --- a/packages/app-mobile/components/biometrics/BiometricPopup.tsx +++ b/packages/app-mobile/components/biometrics/BiometricPopup.tsx @@ -9,6 +9,7 @@ import { _ } from '@joplin/lib/locale'; interface Props { themeId: number; sensorInfo: SensorInfo; + dispatch: Function; } export default (props: Props) => { @@ -49,6 +50,11 @@ export default (props: Props) => { } else { setTryBiometricsCheck(true); } + + props.dispatch({ + type: 'BIOMETRICS_DONE_SET', + value: true, + }); }; Alert.alert( @@ -67,7 +73,7 @@ export default (props: Props) => { }, ] ); - }, [initialPromptDone, props.sensorInfo.supportedSensors, display]); + }, [initialPromptDone, props.sensorInfo.supportedSensors, display, props.dispatch]); const windowSize = useMemo(() => { return { @@ -76,6 +82,15 @@ export default (props: Props) => { }; }, []); + useEffect(() => { + if (!display) { + props.dispatch({ + type: 'BIOMETRICS_DONE_SET', + value: true, + }); + } + }, [display, props.dispatch]); + const renderTryAgainButton = () => { if (!display || tryBiometricsCheck || !initialPromptDone) return null; return