Don't submit empty strings

This commit is contained in:
Edward Shen 2022-07-27 20:06:12 -07:00
parent 50e76ae3a0
commit 600d04eba9
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -47,8 +47,10 @@ const PasteForm = () => {
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => { const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault(); event.preventDefault();
if (value.trim() !== "") {
encrypt_string(value); encrypt_string(value);
} }
}
return ( return (
<form className='hljs centered' onSubmit={handleSubmit}> <form className='hljs centered' onSubmit={handleSubmit}>