fix(frontend): fix type mismatch in revision-viewer.tsx

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-09-24 10:44:15 +02:00 committed by renovate[bot]
parent 41fb6f9e2e
commit a1a09f07d0

View file

@ -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) {