remove another localstorage reference on server
This commit is contained in:
parent
e6c693f241
commit
57f1e551a3
|
@ -6,16 +6,20 @@ import { COMMENTS } from '../fragments/comments'
|
|||
import { useMe } from './me'
|
||||
import ActionTooltip from './action-tooltip'
|
||||
import TextareaAutosize from 'react-textarea-autosize'
|
||||
import { useState } from 'react'
|
||||
import { useLayoutEffect, useState } from 'react'
|
||||
|
||||
export const CommentSchema = Yup.object({
|
||||
text: Yup.string().required('required').trim()
|
||||
})
|
||||
|
||||
export default function Reply ({ parentId, onSuccess, replyOpen }) {
|
||||
const [reply, setReply] = useState(replyOpen || !!localStorage.getItem('reply-' + parentId + '-' + 'text'))
|
||||
const [reply, setReply] = useState(replyOpen)
|
||||
const me = useMe()
|
||||
|
||||
useLayoutEffect(() => {
|
||||
setReply(replyOpen || !!localStorage.getItem('reply-' + parentId + '-' + 'text'))
|
||||
}, [])
|
||||
|
||||
const [createComment] = useMutation(
|
||||
gql`
|
||||
${COMMENTS}
|
||||
|
|
Loading…
Reference in New Issue