Passcode on the state

This commit is contained in:
Diego Mello 2020-04-27 13:28:03 -03:00
parent ab36dd8193
commit b1a48daca4
1 changed files with 3 additions and 2 deletions

View File

@ -19,13 +19,14 @@ const PasscodeEnter = ({ theme, finishProcess }) => {
const ref = useRef(null); const ref = useRef(null);
let attempts = 0; let attempts = 0;
let lockedUntil = false; let lockedUntil = false;
let passcode = null; const [passcode, setPasscode] = useState(null);
const [status, setStatus] = useState(TYPE.ENTER); const [status, setStatus] = useState(TYPE.ENTER);
const { getItem: getAttempts, setItem: setAttempts } = useAsyncStorage(ATTEMPTS_KEY); const { getItem: getAttempts, setItem: setAttempts } = useAsyncStorage(ATTEMPTS_KEY);
const { setItem: setLockedUntil } = useAsyncStorage(LOCKED_OUT_TIMER_KEY); const { setItem: setLockedUntil } = useAsyncStorage(LOCKED_OUT_TIMER_KEY);
const fetchPasscode = async() => { const fetchPasscode = async() => {
passcode = await RNUserDefaults.get(PASSCODE_KEY); const p = await RNUserDefaults.get(PASSCODE_KEY);
setPasscode(p);
}; };
const readStorage = async() => { const readStorage = async() => {