Fix effect

This commit is contained in:
MartinBraquet
2025-10-20 12:56:42 +02:00
parent 3d31ebb576
commit edf30897f2

View File

@@ -18,15 +18,15 @@ export function ProfileBio(props: {
const editor = useTextEditor({defaultValue: ''})
const [textLength, setTextLength] = useState(MAX_INT)
if (!isCurrentUser && !profile.bio) return null
if (fromProfilePage && !profile.bio) return null
useEffect(() => {
if (!editor) return
editor.commands.setContent(profile.bio as JSONContent)
setTextLength(editor.getText().length)
}, [profile.bio, editor])
if (!isCurrentUser && !profile.bio) return null
if (fromProfilePage && !profile.bio) return null
return (
<Col>
{textLength < MIN_BIO_LENGTH && !edit && (