sync fixes

This commit is contained in:
zadam
2020-08-27 22:11:17 +02:00
parent ef996f3919
commit 355780c595
2 changed files with 6 additions and 7 deletions

View File

@@ -3,13 +3,13 @@ const log = require('./log');
const entityChangesService = require('./entity_changes.js');
const eventService = require('./events');
function updateEntity(sync, entity, sourceId) {
function updateEntity(entityChange, entity, sourceId) {
// can be undefined for options with isSynced=false
if (!entity) {
return false;
}
const {entityName} = sync;
const {entityName} = entityChange;
let updated;
if (entityName === 'notes') {
@@ -28,7 +28,7 @@ function updateEntity(sync, entity, sourceId) {
updated = updateNoteRevisionContent(entity, sourceId);
}
else if (entityName === 'note_reordering') {
updated = updateNoteReordering(sync.entityId, entity, sourceId);
updated = updateNoteReordering(entityChange.entityId, entity, sourceId);
}
else if (entityName === 'options') {
updated = updateOptions(entity, sourceId);