From 60e530c793be15554230a44f71ff1067b744a880 Mon Sep 17 00:00:00 2001 From: Lindsay Morales Date: Thu, 25 Jul 2024 23:22:29 -0600 Subject: [PATCH] Fix: blank posts and comments --- JoyboyCommunity/src/screens/CreatePost/index.tsx | 2 +- JoyboyCommunity/src/screens/PostDetail/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/JoyboyCommunity/src/screens/CreatePost/index.tsx b/JoyboyCommunity/src/screens/CreatePost/index.tsx index 51de192f..be7976a1 100644 --- a/JoyboyCommunity/src/screens/CreatePost/index.tsx +++ b/JoyboyCommunity/src/screens/CreatePost/index.tsx @@ -40,7 +40,7 @@ export const CreatePost: React.FC = ({navigation}) => { }; const handleSendNote = async () => { - if (!note || note?.length == 0) { + if (!note || note?.trim().length == 0) { showToast({type: 'error', title: 'Please write your note'}); return; } diff --git a/JoyboyCommunity/src/screens/PostDetail/index.tsx b/JoyboyCommunity/src/screens/PostDetail/index.tsx index e21d9bf0..024a18f1 100644 --- a/JoyboyCommunity/src/screens/PostDetail/index.tsx +++ b/JoyboyCommunity/src/screens/PostDetail/index.tsx @@ -23,7 +23,7 @@ export const PostDetail: React.FC = ({navigation, route}) const {showToast} = useToast(); const handleSendComment = async () => { - if (!comment || comment?.length == 0) { + if (!comment || comment?.trim().length == 0) { showToast({type: 'error', title: 'Please write your comment'}); return; }