Skip to content

Commit

Permalink
Update NewMessageForm.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AxeRicin committed Dec 29, 2023
1 parent e477316 commit b552ea2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions frontend/src/Components/NewMessageForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ const NewMessageForm = ({ currentChannelID }) => {
onSubmit: async (values) => {
try {
const message = { body: filter.clean(values.body), channelId: currentChannelID, username };
await sendNewMessage(message).then(() => {
formik.values.body = '';
formik.setSubmitting(false);
});
await sendNewMessage(message);
formik.values.body = '';
formik.setSubmitting(false);
} catch (err) {
formik.setSubmitting(false);
return toast.error(t('notifications.connection_error'));
toast.error(t('notifications.connection_error'));
}
},
});
Expand Down

0 comments on commit b552ea2

Please sign in to comment.