mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-02 10:00:57 -05:00
Fix hooks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user