diff --git a/src/services/sync.js b/src/services/sync.js index 175704142..3a2b32e89 100644 --- a/src/services/sync.js +++ b/src/services/sync.js @@ -252,12 +252,9 @@ async function getEntityRow(entityName, entityId) { const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]); - if (entityName === 'notes' && entity.type === 'file') { + if (entityName === 'notes' && (entity.type === 'file' || entity.type === 'image')) { entity.content = entity.content.toString("binary"); } - else if (entityName === 'images') { - entity.data = entity.data.toString('base64'); - } return entity; } diff --git a/src/services/sync_update.js b/src/services/sync_update.js index 6db5cd9bb..a915cebb5 100644 --- a/src/services/sync_update.js +++ b/src/services/sync_update.js @@ -39,7 +39,7 @@ async function updateEntity(sync, entity, sourceId) { } function deserializeNoteContentBuffer(note) { - if (note.type === 'file') { + if (note.type === 'file' || note.type === 'image') { note.content = new Buffer(note.content, 'binary'); } }