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