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) => {
diff --git a/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx b/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx
index b6106e6..a801b5a 100644
--- a/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx
+++ b/packages/concordia-app/src/views/Topic/TopicCreate/index.jsx
@@ -25,8 +25,6 @@ const TopicCreate = (props) => {
const transactions = useSelector((state) => state.transactions);
const [subjectInput, setSubjectInput] = useState('');
const [contentInput, setContentInput] = useState('');
- const [topicSubjectInputEmptySubmit, setTopicSubjectInputEmptySubmit] = useState(false);
- const [topicMessageInputEmptySubmit, setTopicMessageInputEmptySubmit] = useState(false);
const [createTopicCacheSendStackId, setCreateTopicCacheSendStackId] = useState('');
const [posting, setPosting] = useState(false);
@@ -90,13 +88,7 @@ const TopicCreate = (props) => {
}, [createTopicCacheSendStackId, history, contentInput, posting, subjectInput, transactionStack, transactions]);
const validateAndPost = useCallback(() => {
- if (subjectInput === '') {
- setTopicSubjectInputEmptySubmit(true);
- return;
- }
-
- if (contentInput === '') {
- setTopicMessageInputEmptySubmit(true);
+ if (subjectInput === '' || contentInput === '') {
return;
}
@@ -116,7 +108,6 @@ const TopicCreate = (props) => {
placeholder={t('topic.create.form.subject.field.placeholder')}
name="subjectInput"
className="form-input"
- error={topicSubjectInputEmptySubmit}
value={subjectInput}
onChange={handleSubjectInputChange}
/>
@@ -128,9 +119,6 @@ const TopicCreate = (props) => {