diff --git a/packages/concordia-app/src/components/PostCreate/index.jsx b/packages/concordia-app/src/components/PostCreate/index.jsx index e13f343..fcaec71 100644 --- a/packages/concordia-app/src/components/PostCreate/index.jsx +++ b/packages/concordia-app/src/components/PostCreate/index.jsx @@ -30,8 +30,6 @@ const PostCreate = (props) => { const [postSubject, setPostSubject] = useState(initialPostSubject); const [postContent, setPostContent] = useState(''); const [userProfilePictureUrl, setUserProfilePictureUrl] = useState(); - const [postSubjectInputEmptySubmit, setPostSubjectInputEmptySubmit] = useState(false); - const [postContentInputEmptySubmit, setPostContentInputEmptySubmit] = useState(false); const [createPostCacheSendStackId, setCreatePostCacheSendStackId] = useState(''); const [posting, setPosting] = useState(false); const [storingPost, setStoringPost] = useState(false); @@ -103,8 +101,7 @@ const PostCreate = (props) => { setPostSubject(initialPostSubject); setPostContent(''); setPosting(false); - setPostSubjectInputEmptySubmit(false); - setPostContentInputEmptySubmit(false); + setStoringPost(false); setCreatePostCacheSendStackId(''); }) .catch((reason) => { @@ -120,13 +117,7 @@ const PostCreate = (props) => { ]); const savePost = useCallback(() => { - if (postSubject === '') { - setPostSubjectInputEmptySubmit(true); - return; - } - - if (postContent === '') { - setPostContentInputEmptySubmit(true); + if (postSubject === '' || postContent === '') { return; } @@ -162,7 +153,6 @@ const PostCreate = (props) => { name="postSubject" className="subject-input" size="mini" - error={postSubjectInputEmptySubmit} value={postSubject} onChange={handleInputChange} /> @@ -176,10 +166,8 @@ const PostCreate = (props) => {