prevent re-setting unchanged objects
This commit is contained in:
@@ -351,10 +351,14 @@ export class Chat {
|
||||
addObject = (messageObject: MessageObject): void => {
|
||||
const existingObject = this.objects.value.get(messageObject.id);
|
||||
if (existingObject) {
|
||||
let didChangeObject = existingObject.title != messageObject.title;
|
||||
existingObject.title = messageObject.title;
|
||||
Object.values(messageObject.contentVersions).forEach((content) => {
|
||||
if (existingObject.contentVersions[content.id]) return;
|
||||
this.addObjectContent(existingObject, content);
|
||||
didChangeObject = true;
|
||||
});
|
||||
if (didChangeObject == false) return;
|
||||
this.objects.set(existingObject.id, existingObject);
|
||||
} else {
|
||||
this.objects.set(messageObject.id, messageObject);
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as React from "bloatless-react";
|
||||
import { Chat, MessageObject } from "../../Model/chatModel";
|
||||
|
||||
import { ObjectEntryView } from "./objectEntryView";
|
||||
import { PlaceholderView } from "./placeholderView";
|
||||
|
||||
export function ObjectGridView(
|
||||
chat: Chat,
|
||||
|
||||
Reference in New Issue
Block a user