mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix posting field checks
This commit is contained in:
@@ -210,6 +210,15 @@ const Thread = () => {
|
||||
const handleSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (
|
||||
commentRef.current.value === "" &&
|
||||
linkRef.current.value === ""
|
||||
) {
|
||||
setErrorMessage("Please enter a comment or link.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
||||
...prevPublishCommentOptions,
|
||||
author: {
|
||||
@@ -225,7 +234,7 @@ const Thread = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (publishCommentOptions.content && triggerPublishComment) {
|
||||
if (publishCommentOptions && triggerPublishComment) {
|
||||
(async () => {
|
||||
await publishComment();
|
||||
resetFields();
|
||||
|
||||
Reference in New Issue
Block a user