mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
add alert subject field, fix post only subject
This commit is contained in:
@@ -257,6 +257,11 @@ const Board = () => {
|
||||
|
||||
const handleSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (subjectRef.current.value === "") {
|
||||
setErrorMessage('Subject field is mandatory');
|
||||
return;
|
||||
}
|
||||
|
||||
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
||||
...prevPublishCommentOptions,
|
||||
@@ -273,7 +278,7 @@ const Board = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (publishCommentOptions.content && triggerPublishComment) {
|
||||
if (publishCommentOptions.subject && triggerPublishComment) {
|
||||
(async () => {
|
||||
await publishComment();
|
||||
resetFields();
|
||||
|
||||
@@ -182,6 +182,11 @@ const Catalog = () => {
|
||||
|
||||
const handleSubmit = async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (subjectRef.current.value === "") {
|
||||
setErrorMessage('Subject field is mandatory');
|
||||
return;
|
||||
}
|
||||
|
||||
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
||||
...prevPublishCommentOptions,
|
||||
@@ -198,7 +203,7 @@ const Catalog = () => {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (publishCommentOptions.content && triggerPublishComment) {
|
||||
if (publishCommentOptions.subject && triggerPublishComment) {
|
||||
(async () => {
|
||||
await publishComment();
|
||||
resetFields();
|
||||
|
||||
Reference in New Issue
Block a user