initial implementation of note attachments

This commit is contained in:
zadam
2023-01-22 23:36:05 +01:00
parent 6a6ae359b6
commit 339d8a7378
20 changed files with 2447 additions and 233 deletions

View File

@@ -64,7 +64,7 @@ function updateNormalEntity(remoteEntityChange, remoteEntityRow, instanceId) {
|| localEntityChange.utcDateChanged < remoteEntityChange.utcDateChanged
|| localEntityChange.hash !== remoteEntityChange.hash // sync error, we should still update
) {
if (['note_contents', 'note_revision_contents'].includes(remoteEntityChange.entityName)) {
if (['note_contents', 'note_revision_contents', 'note_attachment_contents'].includes(remoteEntityChange.entityName)) {
remoteEntityRow.content = handleContent(remoteEntityRow.content);
}
@@ -109,7 +109,18 @@ function handleContent(content) {
function eraseEntity(entityChange, instanceId) {
const {entityName, entityId} = entityChange;
if (!["notes", "note_contents", "branches", "attributes", "note_revisions", "note_revision_contents"].includes(entityName)) {
const entityNames = [
"notes",
"note_contents",
"branches",
"attributes",
"note_revisions",
"note_revision_contents",
"note_attachments",
"note_attachment_contents"
];
if (!entityNames.includes(entityName)) {
log.error(`Cannot erase entity '${entityName}', id '${entityId}'`);
return;
}