mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-24 18:56:32 -05:00
fix(frontend): fix type mismatch in revision-viewer.tsx
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
41fb6f9e2e
commit
a1a09f07d0
1 changed files with 6 additions and 4 deletions
|
@ -43,10 +43,12 @@ export const RevisionViewer: React.FC<RevisionViewerProps> = ({ selectedRevision
|
|||
if (revision === undefined) {
|
||||
return ''
|
||||
}
|
||||
const patch = parsePatch(revision.patch)[0]
|
||||
const inversePatch = invertUnifiedPatch(patch)
|
||||
const reverseContent = applyPatch(revision.content, inversePatch)
|
||||
return reverseContent === false ? '' : reverseContent
|
||||
const patches = parsePatch(revision.patch)
|
||||
if (patches.length === 0) {
|
||||
return ''
|
||||
}
|
||||
const inversePatch = invertUnifiedPatch(patches[0])
|
||||
return applyPatch(revision.content, inversePatch)
|
||||
}, [revision])
|
||||
|
||||
if (selectedRevisionId === undefined) {
|
||||
|
|
Loading…
Reference in a new issue