file revisions preview

This commit is contained in:
zadam
2019-11-09 13:01:05 +01:00
parent 60ac1a04f4
commit 664485ccd5
5 changed files with 107 additions and 79 deletions

View File

@@ -19,7 +19,14 @@ async function getNoteRevisions(req) {
async function getNoteRevision(req) {
const noteRevision = await repository.getNoteRevision(req.params.noteRevisionId);
if (noteRevision.type !== 'file') {
if (noteRevision.type === 'file') {
if (noteRevision.isStringNote()) {
await noteRevision.getContent();
noteRevision.content = noteRevision.content.substr(0, 10000);
}
}
else {
await noteRevision.getContent();
if (noteRevision.content && noteRevision.type === 'image') {