mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
fix(frontend): error in review viewer
Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
ee5b54c7b6
commit
f6cfe74d8c
1 changed files with 2 additions and 4 deletions
|
@ -32,9 +32,7 @@ export const RevisionViewer: React.FC<RevisionViewerProps> = ({ selectedRevision
|
||||||
error,
|
error,
|
||||||
loading
|
loading
|
||||||
} = useAsync(async () => {
|
} = useAsync(async () => {
|
||||||
if (noteId === undefined || selectedRevisionId === undefined) {
|
if (noteId && selectedRevisionId !== undefined) {
|
||||||
throw new Error('No revision selected')
|
|
||||||
} else {
|
|
||||||
return await getRevision(noteId, selectedRevisionId)
|
return await getRevision(noteId, selectedRevisionId)
|
||||||
}
|
}
|
||||||
}, [selectedRevisionId, noteId])
|
}, [selectedRevisionId, noteId])
|
||||||
|
@ -51,7 +49,7 @@ export const RevisionViewer: React.FC<RevisionViewerProps> = ({ selectedRevision
|
||||||
return applyPatch(revision.content, inversePatch) || ''
|
return applyPatch(revision.content, inversePatch) || ''
|
||||||
}, [revision])
|
}, [revision])
|
||||||
|
|
||||||
if (selectedRevisionId === undefined) {
|
if (!noteId || selectedRevisionId === undefined) {
|
||||||
return <Fragment />
|
return <Fragment />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue