15 lines
432 B
TypeScript
15 lines
432 B
TypeScript
import AsyncStorage from '@react-native-community/async-storage';
|
|
import moment from 'moment';
|
|
|
|
import { LOCKED_OUT_TIMER_KEY, TIME_TO_LOCK } from '../../constants/localAuthentication';
|
|
|
|
export const getLockedUntil = async() => {
|
|
const t: any = await AsyncStorage.getItem(LOCKED_OUT_TIMER_KEY);
|
|
if (t) {
|
|
return moment(t).add(TIME_TO_LOCK);
|
|
}
|
|
return null;
|
|
};
|
|
// @ts-ignore
|
|
export const getDiff = t => new Date(t) - new Date();
|