mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-28 14:30:59 -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) {
|
if (revision === undefined) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
const patch = parsePatch(revision.patch)[0]
|
const patches = parsePatch(revision.patch)
|
||||||
const inversePatch = invertUnifiedPatch(patch)
|
if (patches.length === 0) {
|
||||||
const reverseContent = applyPatch(revision.content, inversePatch)
|
return ''
|
||||||
return reverseContent === false ? '' : reverseContent
|
}
|
||||||
|
const inversePatch = invertUnifiedPatch(patches[0])
|
||||||
|
return applyPatch(revision.content, inversePatch)
|
||||||
}, [revision])
|
}, [revision])
|
||||||
|
|
||||||
if (selectedRevisionId === undefined) {
|
if (selectedRevisionId === undefined) {
|
||||||
|
|
Loading…
Reference in a new issue