ignore incoming objects when unchanged

This commit is contained in:
marlon-erler
2024-07-13 11:24:58 +02:00
parent 23a3d1b1f1
commit 0f7d781fd5
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -958,11 +958,14 @@
addObject = (messageObject, ignoreIfUnchanged = false) => {
const existingObject = this.objects.value.get(messageObject.id);
if (existingObject) {
let isIdentical = existingObject.title == messageObject.title;
existingObject.title = messageObject.title;
Object.values(messageObject.contentVersions).forEach((content) => {
if (existingObject.contentVersions[content.id]) return;
this.addObjectContent(existingObject, content);
isIdentical = false;
});
if (isIdentical && ignoreIfUnchanged) return;
this.objects.set(existingObject.id, existingObject);
} else {
this.objects.set(messageObject.id, messageObject);