From 27975e3ca5167099978a75ae4b38396af1749e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 16 Apr 2023 19:56:40 +0200 Subject: [PATCH] Fix character count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/features/compose/components/compose-form.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/compose/components/compose-form.tsx b/app/soapbox/features/compose/components/compose-form.tsx index 01f485caf..57bbd7664 100644 --- a/app/soapbox/features/compose/components/compose-form.tsx +++ b/app/soapbox/features/compose/components/compose-form.tsx @@ -75,7 +75,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab const scheduledStatusCount = useAppSelector((state) => state.scheduled_statuses.size); const features = useFeatures(); - const { text, spoiler, spoiler_text: spoilerText, privacy, focusDate, caretPosition, is_submitting: isSubmitting, is_changing_upload: isChangingUpload, is_uploading: isUploading, schedule: scheduledAt, group_id: groupId } = compose; + const { spoiler, spoiler_text: spoilerText, privacy, focusDate, caretPosition, is_submitting: isSubmitting, is_changing_upload: isChangingUpload, is_uploading: isUploading, schedule: scheduledAt, group_id: groupId } = compose; const prevSpoiler = usePrevious(spoiler); const hasPoll = !!compose.poll; @@ -88,6 +88,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab const spoilerTextRef = useRef(null); const autosuggestTextareaRef = useRef(null); const editorStateRef = useRef(null); + const text = editorStateRef.current || ''; const getClickableArea = () => { return clickableAreaRef ? clickableAreaRef.current : formRef.current;