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; }