Clear autosave on submit post/market/comment
This commit is contained in:
parent
9736e2d4b4
commit
21b6db3c37
|
@ -88,7 +88,7 @@ export function CommentInputTextArea(props: {
|
|||
|
||||
const submit = () => {
|
||||
submitComment()
|
||||
editor?.commands?.clearContent()
|
||||
editor?.commands?.clearContent(true)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -46,6 +46,7 @@ export function CreatePost(props: { group?: Group }) {
|
|||
return e
|
||||
})
|
||||
if (result.post) {
|
||||
editor.commands.clearContent(true)
|
||||
await Router.push(postPath(result.post.slug))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ export function useTextEditor(props: {
|
|||
defaultValue?: Content
|
||||
disabled?: boolean
|
||||
simple?: boolean
|
||||
key?: string // unique key for this text field for autosave
|
||||
key?: string // unique key for autosave. If set, plz call `clearContent(true)` on submit to clear autosave
|
||||
}) {
|
||||
const { placeholder, max, defaultValue, disabled, simple, key } = props
|
||||
|
||||
|
|
|
@ -269,6 +269,7 @@ export function NewContract(props: {
|
|||
selectedGroup: selectedGroup?.id,
|
||||
isFree: false,
|
||||
})
|
||||
editor?.commands.clearContent(true)
|
||||
await router.push(contractPath(result as Contract))
|
||||
} catch (e) {
|
||||
console.error('error creating contract', e, (e as any).details)
|
||||
|
|
Loading…
Reference in New Issue
Block a user