fix(frontend): fix revision-viewer type

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-10-19 20:18:07 +02:00 committed by renovate[bot]
parent 982783c8cf
commit 386d5700cf

View file

@ -48,7 +48,7 @@ export const RevisionViewer: React.FC<RevisionViewerProps> = ({ selectedRevision
return ''
}
const inversePatch = invertUnifiedPatch(patches[0])
return applyPatch(revision.content, inversePatch)
return applyPatch(revision.content, inversePatch) || ''
}, [revision])
if (selectedRevisionId === undefined) {
@ -58,7 +58,7 @@ export const RevisionViewer: React.FC<RevisionViewerProps> = ({ selectedRevision
return (
<AsyncLoadingBoundary loading={loading || !revision} componentName={'RevisionViewer'} error={error}>
<ReactDiffViewer
oldValue={previousRevisionContent ?? ''}
oldValue={previousRevisionContent}
newValue={revision?.content ?? ''}
splitView={false}
compareMethod={DiffMethod.WORDS}