1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed node loading hook

This commit is contained in:
Fedor Katurov 2021-11-21 16:49:21 +07:00
parent 4c4461ea19
commit 0dc5ae99a3
7 changed files with 35 additions and 16 deletions

View file

@ -36,10 +36,13 @@ export const useNodeFormFormik = (
stopEditing: () => void
) => {
const dispatch = useDispatch();
const onSubmit = useCallback((values: INode, helpers: FormikHelpers<INode>) => {
helpers.setSubmitting(true);
dispatch(nodeSubmitLocal(values, onSuccess(helpers)));
}, [dispatch]);
const onSubmit = useCallback(
(values: INode, helpers: FormikHelpers<INode>) => {
helpers.setSubmitting(true);
dispatch(nodeSubmitLocal(values, onSuccess(helpers)));
},
[dispatch]
);
const { current: initialValues } = useRef(values);