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 = () => {
|
const submit = () => {
|
||||||
submitComment()
|
submitComment()
|
||||||
editor?.commands?.clearContent()
|
editor?.commands?.clearContent(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
@ -46,6 +46,7 @@ export function CreatePost(props: { group?: Group }) {
|
||||||
return e
|
return e
|
||||||
})
|
})
|
||||||
if (result.post) {
|
if (result.post) {
|
||||||
|
editor.commands.clearContent(true)
|
||||||
await Router.push(postPath(result.post.slug))
|
await Router.push(postPath(result.post.slug))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ export function useTextEditor(props: {
|
||||||
defaultValue?: Content
|
defaultValue?: Content
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
simple?: 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
|
const { placeholder, max, defaultValue, disabled, simple, key } = props
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,7 @@ export function NewContract(props: {
|
||||||
selectedGroup: selectedGroup?.id,
|
selectedGroup: selectedGroup?.id,
|
||||||
isFree: false,
|
isFree: false,
|
||||||
})
|
})
|
||||||
|
editor?.commands.clearContent(true)
|
||||||
await router.push(contractPath(result as Contract))
|
await router.push(contractPath(result as Contract))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error creating contract', e, (e as any).details)
|
console.error('error creating contract', e, (e as any).details)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user