fixes of recent entity changes

This commit is contained in:
zadam
2020-12-14 14:17:51 +01:00
parent 6d7b9e0db3
commit 8b99f065d5
11 changed files with 96 additions and 65 deletions

View File

@@ -44,20 +44,20 @@ function isEntityEventsDisabled() {
return !!namespace.get('disableEntityEvents');
}
function getAndClearSyncRows() {
const syncRows = namespace.get('syncRows') || [];
function getAndClearEntityChanges() {
const entityChanges = namespace.get('entityChanges') || [];
namespace.set('syncRows', []);
namespace.set('entityChanges', []);
return syncRows;
return entityChanges;
}
function addSyncRow(syncRow) {
const syncRows = namespace.get('syncRows') || [];
function addEntityChange(entityChange) {
const entityChanges = namespace.get('entityChanges') || [];
syncRows.push(syncRow);
entityChanges.push(entityChange);
namespace.set('syncRows', syncRows);
namespace.set('entityChanges', entityChanges);
}
function reset() {
@@ -84,8 +84,8 @@ module.exports = {
disableEntityEvents,
isEntityEventsDisabled,
reset,
getAndClearSyncRows,
addSyncRow,
getAndClearEntityChanges,
addEntityChange,
getEntityFromCache,
setEntityToCache
};