checkfix
This commit is contained in:
parent
95fb194a96
commit
39dd78e25d
|
@ -69,12 +69,13 @@ export const EditView = (props: Props) => {
|
||||||
const shoutTopics = props.shout.topics || []
|
const shoutTopics = props.shout.topics || []
|
||||||
|
|
||||||
const draft = getDraftFromLocalStorage(props.shout.id)
|
const draft = getDraftFromLocalStorage(props.shout.id)
|
||||||
let draftForm
|
|
||||||
if (draft) {
|
if (draft) {
|
||||||
draftForm = Object.keys(draft).length !== 0 ? draft : { shoutId: props.shout.id }
|
const draftForm = Object.keys(draft).length !== 0 ? draft : { shoutId: props.shout.id }
|
||||||
|
setForm(draftForm)
|
||||||
console.debug('draft from localstorage: ', draftForm)
|
console.debug('draft from localstorage: ', draftForm)
|
||||||
} else {
|
} else {
|
||||||
draftForm = {
|
const draftForm = {
|
||||||
slug: props.shout.slug,
|
slug: props.shout.slug,
|
||||||
shoutId: props.shout.id,
|
shoutId: props.shout.id,
|
||||||
title: props.shout.title,
|
title: props.shout.title,
|
||||||
|
@ -88,9 +89,10 @@ export const EditView = (props: Props) => {
|
||||||
media: props.shout.media,
|
media: props.shout.media,
|
||||||
layout: props.shout.layout,
|
layout: props.shout.layout,
|
||||||
}
|
}
|
||||||
|
setForm(draftForm)
|
||||||
console.debug('draft from props data: ', draftForm)
|
console.debug('draft from props data: ', draftForm)
|
||||||
}
|
}
|
||||||
draftForm && setForm(draftForm)
|
|
||||||
const subtitleInput: { current: HTMLTextAreaElement } = { current: null }
|
const subtitleInput: { current: HTMLTextAreaElement } = { current: null }
|
||||||
|
|
||||||
const [prevForm, setPrevForm] = createStore<ShoutForm>(clone(form))
|
const [prevForm, setPrevForm] = createStore<ShoutForm>(clone(form))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user