Skip to content

Commit

Permalink
Add a fail safe
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed Nov 14, 2023
1 parent e733590 commit 10067bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dashboard/atoms/EntryEditorAtoms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ export const entryEditorAtoms = atomFamily(
// - the draft storage could not be reached after mutation
// We fast forward the draft with the actual current field data
// and will submit new updates including it
if (draft.fileHash !== entry!.fileHash)
const matches = draft.fileHash === entry!.fileHash
const isEmpty = !edits.hasData()
if (!matches || isEmpty) {
edits.applyEntryData(type, entry!.data)
}
} else {
edits.applyEntryData(type, entry!.data)
}
Expand Down

0 comments on commit 10067bf

Please sign in to comment.