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:
@@ -258,6 +258,11 @@ const Board = () => {
|
|||||||
const handleSubmit = async (event) => {
|
const handleSubmit = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (subjectRef.current.value === "") {
|
||||||
|
setErrorMessage('Subject field is mandatory');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
||||||
...prevPublishCommentOptions,
|
...prevPublishCommentOptions,
|
||||||
author: {
|
author: {
|
||||||
@@ -273,7 +278,7 @@ const Board = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (publishCommentOptions.content && triggerPublishComment) {
|
if (publishCommentOptions.subject && triggerPublishComment) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishComment();
|
await publishComment();
|
||||||
resetFields();
|
resetFields();
|
||||||
|
|||||||
@@ -183,6 +183,11 @@ const Catalog = () => {
|
|||||||
const handleSubmit = async (event) => {
|
const handleSubmit = async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (subjectRef.current.value === "") {
|
||||||
|
setErrorMessage('Subject field is mandatory');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
setPublishCommentOptions((prevPublishCommentOptions) => ({
|
||||||
...prevPublishCommentOptions,
|
...prevPublishCommentOptions,
|
||||||
author: {
|
author: {
|
||||||
@@ -198,7 +203,7 @@ const Catalog = () => {
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (publishCommentOptions.content && triggerPublishComment) {
|
if (publishCommentOptions.subject && triggerPublishComment) {
|
||||||
(async () => {
|
(async () => {
|
||||||
await publishComment();
|
await publishComment();
|
||||||
resetFields();
|
resetFields();
|
||||||
|
|||||||
Reference in New Issue
Block a user