mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-22 20:51:13 +00: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,
|
||||
loading
|
||||
} = useAsync(async () => {
|
||||
if (noteId === undefined || selectedRevisionId === undefined) {
|
||||
throw new Error('No revision selected')
|
||||
} else {
|
||||
if (noteId && selectedRevisionId !== undefined) {
|
||||
return await getRevision(noteId, selectedRevisionId)
|
||||
}
|
||||
}, [selectedRevisionId, noteId])
|
||||
|
@ -51,7 +49,7 @@ export const RevisionViewer: React.FC<RevisionViewerProps> = ({ selectedRevision
|
|||
return applyPatch(revision.content, inversePatch) || ''
|
||||
}, [revision])
|
||||
|
||||
if (selectedRevisionId === undefined) {
|
||||
if (!noteId || selectedRevisionId === undefined) {
|
||||
return <Fragment />
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue