diff --git a/src/hooks/usePasscodeEntryRevealer.ts b/src/hooks/usePasscodeEntryRevealer.ts index dc973b69d..4b4914ea3 100644 --- a/src/hooks/usePasscodeEntryRevealer.ts +++ b/src/hooks/usePasscodeEntryRevealer.ts @@ -4,7 +4,6 @@ import { AirDAOEventType, RootNavigationProp } from '@appTypes'; import { useAppState } from './useAppState'; import usePasscode from '@contexts/Passcode'; import { Cache, CacheKey } from '@lib/cache'; -import { DeviceUtils } from '@utils/device'; import { AirDAOEventDispatcher } from '@lib'; export const usePasscodeEntryRevealer = () => { @@ -25,8 +24,7 @@ export const usePasscodeEntryRevealer = () => { return; } - // hack around old android devices - if (DeviceUtils.isAndroid && isBiometricAuthenticationInProgress) { + if (isBiometricAuthenticationInProgress) { await Cache.setItem(CacheKey.isBiometricAuthenticationInProgress, false); return; } diff --git a/src/screens/PasscodeEntry/index.tsx b/src/screens/PasscodeEntry/index.tsx index 6529e14ad..dbcc0ca46 100644 --- a/src/screens/PasscodeEntry/index.tsx +++ b/src/screens/PasscodeEntry/index.tsx @@ -17,7 +17,6 @@ import { COLORS } from '@constants/colors'; import usePasscode from '@contexts/Passcode'; import { RootNavigationProp } from '@appTypes'; import { Cache, CacheKey } from '@lib/cache'; -import { DeviceUtils } from '@utils/device'; export const PasscodeEntry = () => { const isAuthSuccessfulRef = useRef(false); @@ -28,7 +27,7 @@ export const PasscodeEntry = () => { const { isFaceIDEnabled } = usePasscode(); const supportedBiometrics = useSupportedBiometrics(); const passcodeRef = useRef(null); - const { appState, prevState } = useAppState(); + const { appState } = useAppState(); const automaticFaceIdCalled = useRef(false); const closePasscodeEntry = useCallback(() => { @@ -44,10 +43,7 @@ export const PasscodeEntry = () => { const authenticateWithFaceID = useCallback(async () => { automaticFaceIdCalled.current = true; - // This is a hack around older Android versions. They unmounts and remounts app after fingerprint prompt. By holding the value in cache, we can check if app comes from Biometric check - if (DeviceUtils.isAndroid) { - await Cache.setItem(CacheKey.isBiometricAuthenticationInProgress, true); - } + await Cache.setItem(CacheKey.isBiometricAuthenticationInProgress, true); try { const result = await LocalAuthentication.authenticateAsync({ promptMessage: t('security.authenticate.with.face.id'), @@ -62,33 +58,28 @@ export const PasscodeEntry = () => { } catch (error) { // ignore } finally { - if (DeviceUtils.isAndroid) { - await Cache.setItem( - CacheKey.isBiometricAuthenticationInProgress, - false - ); - } + await Cache.setItem(CacheKey.isBiometricAuthenticationInProgress, false); } }, [closePasscodeEntry, t]); useEffect(() => { - if (appState === 'active' && prevState !== 'inactive') { - if (isFaceIDEnabled) { - authenticateWithFaceID(); - } else { - passcodeRef.current?.focus(); - } - } - // if (automaticFaceIdCalled.current) { - // return; - // } - // if (appState === 'active') { + // if (appState === 'active' && prevState !== 'inactive') { // if (isFaceIDEnabled) { // authenticateWithFaceID(); // } else { // passcodeRef.current?.focus(); // } // } + if (automaticFaceIdCalled.current) { + return; + } + if (appState === 'active') { + if (isFaceIDEnabled) { + authenticateWithFaceID(); + } else { + passcodeRef.current?.focus(); + } + } // eslint-disable-next-line react-hooks/exhaustive-deps }, [appState]); diff --git a/src/screens/Settings/Settings.tsx b/src/screens/Settings/Settings.tsx index a65afbc4e..0b1ed39a8 100644 --- a/src/screens/Settings/Settings.tsx +++ b/src/screens/Settings/Settings.tsx @@ -78,7 +78,7 @@ export const SettingsScreen = () => { {SETTINGS_MENU_ITEMS.map(renderMenu)} - {isStage && Build: 1.1.0.12} + {isStage && Build: 1.1.0.13} ); };