fix(post form): user could post empty comment using spaces

This commit is contained in:
Tom (plebeius.eth)
2024-08-29 17:48:34 +02:00
parent 9543f16f68
commit 3d2d510259
2 changed files with 12 additions and 8 deletions
+3 -3
View File
@@ -66,10 +66,10 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s
}, [address, getExistingSigner, getNewSigner, setPublishReplyOptions, anonMode, displayName]);
const onPublishReply = () => {
const currentContent = textRef.current?.value || '';
const currentUrl = urlRef.current?.value || '';
const currentContent = textRef.current?.value.slice(contentPrefix.length).trim() || '';
const currentUrl = urlRef.current?.value.trim() || '';
if (!currentContent.trim() && !currentUrl) {
if (!currentContent && !currentUrl) {
alert(`Cannot post empty comment`);
return;
}