feat: Auto submit 2FA if all inputs have a value (#9729)

* auto submit 2FA if all inputs have a value

* organize imports

* Fix duplicate text issue, this label is part of TwoFactor

* Fixed test that was failing due to enable-2fa not clickable anymore due to auto-submit

* Remove extra newline for clarity

---------

Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
Afzal SayedandAlex van Andel authored and GitHub committed 2023-07-13 20:54:57 +00:00
1 parent 1419c534c8
commit 58d6bb840a
4 files changed
+41 -3

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import { useRef } from "react";
import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
export const useCallbackRef = <C>(callback: C) => {
const callbackRef = useRef(callback);
useIsomorphicLayoutEffect(() => {
callbackRef.current = callback;
});
return callbackRef;
};
export default useCallbackRef;