remove something wrong from props before passing it to recoveryKeyModal

This commit is contained in:
Abhinav-grd 2021-04-05 21:52:54 +05:30
parent 6e26dc1792
commit 9dfca18451

View file

@ -11,7 +11,7 @@ interface Props {
onHide: () => void;
somethingWentWrong: any;
}
function RecoveryKeyModal(props: Props) {
function RecoveryKeyModal({ somethingWentWrong, ...props }: Props) {
const [recoveryKey, setRecoveryKey] = useState(null);
useEffect(() => {
if (!props.show) {
@ -20,7 +20,7 @@ function RecoveryKeyModal(props: Props) {
const main = async () => {
const recoveryKey = await getRecoveryKey();
if (!recoveryKey) {
props.somethingWentWrong();
somethingWentWrong();
props.onHide();
}
setRecoveryKey(recoveryKey);