comment draft saving
This commit is contained in:
parent
e42f1d6bb9
commit
b6a530f5c4
|
@ -17,7 +17,7 @@ export function CommentsHeader ({ handleSort }) {
|
|||
}
|
||||
|
||||
return (
|
||||
<Navbar className='py-0'>
|
||||
<Navbar className='py-1'>
|
||||
<Nav
|
||||
className={styles.navbarNav}
|
||||
activeKey={sort}
|
||||
|
|
|
@ -237,7 +237,6 @@ export function Form ({
|
|||
onSubmit={async (...args) =>
|
||||
onSubmit && onSubmit(...args).then(() => {
|
||||
if (!storageKeyPrefix) return
|
||||
console.log(...args)
|
||||
Object.keys(...args).forEach(v =>
|
||||
localStorage.removeItem(storageKeyPrefix + '-' + v))
|
||||
}).catch(e => setError(e.message || e))}
|
||||
|
|
|
@ -13,7 +13,7 @@ export const CommentSchema = Yup.object({
|
|||
})
|
||||
|
||||
export default function Reply ({ parentId, onSuccess, replyOpen }) {
|
||||
const [reply, setReply] = useState(replyOpen)
|
||||
const [reply, setReply] = useState(replyOpen || !!localStorage.getItem('reply-' + parentId + '-' + 'text'))
|
||||
const me = useMe()
|
||||
|
||||
const [createComment] = useMutation(
|
||||
|
@ -73,6 +73,7 @@ export default function Reply ({ parentId, onSuccess, replyOpen }) {
|
|||
resetForm({ text: '' })
|
||||
setReply(replyOpen || false)
|
||||
}}
|
||||
storageKeyPrefix={'reply-' + parentId}
|
||||
>
|
||||
<MarkdownInput
|
||||
name='text'
|
||||
|
|
Loading…
Reference in New Issue