diff --git a/dist/index.js b/dist/index.js index 444e9221..a3d8453f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); diff --git a/src/Model/chatModel.ts b/src/Model/chatModel.ts index 5197ddae..9469b169 100644 --- a/src/Model/chatModel.ts +++ b/src/Model/chatModel.ts @@ -354,11 +354,15 @@ export class Chat { ): void => { 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);