diff --git a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/revision-viewer.tsx b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/revision-viewer.tsx index ae43db013..af5adfd28 100644 --- a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/revision-viewer.tsx +++ b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/revision-viewer.tsx @@ -43,10 +43,12 @@ export const RevisionViewer: React.FC = ({ 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) {