note revisions changes WIP

This commit is contained in:
zadam
2019-11-01 19:21:48 +01:00
parent cf53cbf1dd
commit 4e5e3e4675
11 changed files with 51 additions and 50 deletions

View File

@@ -102,8 +102,8 @@ async function updateNoteRevision(entity, sourceId) {
await sql.transactional(async () => {
// we update note revision even if date modified to is the same because the only thing which might have changed
// is the protected status (and correnspondingly title and content) which doesn't affect the utcDateModifiedTo
if (orig === null || orig.utcDateModifiedTo <= entity.utcDateModifiedTo) {
// is the protected status (and correnspondingly title and content) which doesn't affect the utcDateCreated
if (orig === null || orig.utcDateCreated <= entity.utcDateCreated) {
entity.content = entity.content === null ? null : Buffer.from(entity.content, 'base64');
await sql.replace('note_revisions', entity);