diff --git a/app/assets/img/adeya-logo-secondary.png b/app/assets/img/adeya-logo-secondary.png index a9bcfc81..aea2fab9 100644 Binary files a/app/assets/img/adeya-logo-secondary.png and b/app/assets/img/adeya-logo-secondary.png differ diff --git a/app/screens/PINEnter.tsx b/app/screens/PINEnter.tsx index 7df6690e..024e54d2 100644 --- a/app/screens/PINEnter.tsx +++ b/app/screens/PINEnter.tsx @@ -34,7 +34,6 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU const { t } = useTranslation() const { checkPIN, getWalletCredentials, isBiometricsActive, disableBiometrics } = useAuth() const [store, dispatch] = useStore() - const [PIN, setPIN] = useState('') const [continueEnabled, setContinueEnabled] = useState(true) const [displayLockoutWarning, setDisplayLockoutWarning] = useState(false) const [biometricsErr, setBiometricsErr] = useState(false) @@ -261,59 +260,24 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU } } - const handlePINInput = async (PIN: string) => { - setPIN(PIN) - if (usage === PINEntryUsage.PINCheck) { - await verifyPIN(PIN) - } + const handlePinInput = async (PIN: string) => { if (PIN.length === minPINLength) { try { Keyboard.dismiss() - const result = await checkPIN(PIN) - if (!result) { - const newAttempt = store.loginAttempt.loginAttempts + 1 - if (!getLockoutPenalty(newAttempt)) { - // skip displaying modals if we are going to lockout - setAlertModalVisible(true) - } - setContinueEnabled(true) + setContinueEnabled(false) - // log incorrect login attempts - dispatch({ - type: DispatchAction.ATTEMPT_UPDATED, - payload: [{ loginAttempts: newAttempt }], - }) - - return + if (usage === PINEntryUsage.PINCheck) { + await verifyPIN(PIN) } - // reset login attempts if login is successful - dispatch({ - type: DispatchAction.ATTEMPT_UPDATED, - payload: [{ loginAttempts: 0 }], - }) - - setAuthenticated(true) + if (usage === PINEntryUsage.WalletUnlock) { + await unlockWalletWithPIN(PIN) + } } catch (error: unknown) { // TODO:(jl) process error } } } - const onPINInputCompleted = async (PIN: string) => { - try { - setContinueEnabled(false) - - if (usage === PINEntryUsage.PINCheck) { - await verifyPIN(PIN) - } - - if (usage === PINEntryUsage.WalletUnlock) { - await unlockWalletWithPIN(PIN) - } - } catch (error: unknown) { - // TODO:(jl) process error - } - } // NOTE: Using local state here is to prevent modal issues caused by other modals being left open when the device sleeps. // When two modals are attempted to be mounted at once it causes issues on iOS - in this case it causes the second modal @@ -362,7 +326,7 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU {t('PINEnter.EnterPIN')} )} handlePINInput(p)} + onPINChanged={(p: string) => handlePinInput(p)} testID={testIdWithKey('EnterPIN')} accessibilityLabel={t('PINEnter.EnterPIN')} autoFocus={true} @@ -392,12 +356,8 @@ const PINEnter: React.FC = ({ setAuthenticated, usage = PINEntryU title={t('PINEnter.Unlock')} buttonType={ButtonType.Primary} testID={testIdWithKey('Enter')} - disabled={!continueEnabled} - accessibilityLabel={t('PINEnter.Unlock')} - onPress={() => { - Keyboard.dismiss() - onPINInputCompleted(PIN) - }}> + disabled={continueEnabled} + accessibilityLabel={t('PINEnter.Unlock')}> {!continueEnabled && }