Fix hooks

This commit is contained in:
MartinBraquet
2025-10-20 12:55:16 +02:00
parent d3bac8bcc0
commit 3d31ebb576

View File

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