diff --git a/src/components/PasswordAlert.tsx b/src/components/PasswordAlert.tsx index c653d8a..209081d 100644 --- a/src/components/PasswordAlert.tsx +++ b/src/components/PasswordAlert.tsx @@ -20,12 +20,12 @@ import usePassword from '../store/usePassword'; import PasswordInput from './PasswordInput'; -function PasswordAlert(): JSX.Element { +function PasswordAlert(): JSX.Element | null { const [isLoading, setIsLoading] = useState(false); const { form } = usePassword(); const cancelRef = useRef(null); if (!form.register.password || !form.register.remember) { - throw new Error('PasswordAlert: password or remember is not registered'); + return null; } const onSubmit = async () => {