Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/containers/Passcode/Base/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface IPasscodeBase {
previousPasscode?: string;
title: string;
subtitle?: string;
showBiometry?: string;
showBiometry?: boolean;
onEndProcess: Function;
onError?: Function;
onBiometryPress?(): void;
Expand Down
2 changes: 1 addition & 1 deletion app/containers/Passcode/PasscodeEnter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import I18n from '../../i18n';

interface IPasscodePasscodeEnter {
theme: string;
hasBiometry: string;
hasBiometry: boolean;
finishProcess: Function;
}

Expand Down
24 changes: 13 additions & 11 deletions app/views/ScreenLockedView.js → app/views/ScreenLockedView.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import Modal from 'react-native-modal';
import useDeepCompareEffect from 'use-deep-compare-effect';
import isEmpty from 'lodash/isEmpty';
import Orientation from 'react-native-orientation-locker';

import { withTheme } from '../theme';
import { useTheme } from '../theme';
import EventEmitter from '../utils/events';
import { LOCAL_AUTHENTICATE_EMITTER } from '../constants/localAuthentication';
import { isTablet } from '../utils/deviceInfo';
import { PasscodeEnter } from '../containers/Passcode';

const ScreenLockedView = ({ theme }) => {
interface IData {
submit?: () => void;
hasBiometry?: boolean;
}

const ScreenLockedView = (): JSX.Element => {
const [visible, setVisible] = useState(false);
const [data, setData] = useState({});
const [data, setData] = useState<IData>({});

const { theme } = useTheme();

useDeepCompareEffect(() => {
if (!isEmpty(data)) {
Expand All @@ -23,7 +29,7 @@ const ScreenLockedView = ({ theme }) => {
}
}, [data]);

const showScreenLock = args => {
const showScreenLock = (args: IData) => {
setData(args);
};

Expand Down Expand Up @@ -56,13 +62,9 @@ const ScreenLockedView = ({ theme }) => {
style={{ margin: 0 }}
animationIn='fadeIn'
animationOut='fadeOut'>
<PasscodeEnter theme={theme} hasBiometry={data?.hasBiometry} finishProcess={onSubmit} />
<PasscodeEnter theme={theme} hasBiometry={!!data?.hasBiometry} finishProcess={onSubmit} />
</Modal>
);
};

ScreenLockedView.propTypes = {
theme: PropTypes.string
};

export default withTheme(ScreenLockedView);
export default ScreenLockedView;