mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-04 09:06:40 +07:00
made transitional Anchor component for next/cra
This commit is contained in:
parent
7658068caa
commit
14b93d5dbb
7 changed files with 44 additions and 18 deletions
|
@ -1,11 +1,11 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useHistory } from 'react-router';
|
||||
import { useModal } from '~/hooks/modal/useModal';
|
||||
import { Dialog } from '~/constants/modal';
|
||||
import { useNavigation } from '~/hooks/navigation/useNavigation';
|
||||
|
||||
/** redirects to the password redirect modal */
|
||||
export const useRestorePasswordRedirect = () => {
|
||||
const history = useHistory();
|
||||
const { push } = useNavigation();
|
||||
const { showModal } = useModal();
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -15,7 +15,7 @@ export const useRestorePasswordRedirect = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
history.push('/');
|
||||
push('/');
|
||||
showModal(Dialog.RestorePassword, { code: match[1] });
|
||||
}, [showModal, history]);
|
||||
}, [showModal, push]);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue