This commit is contained in:
Timothy J. Baek 2024-09-19 15:35:01 +02:00
parent d52eaf19d6
commit 5c16631ec5
2 changed files with 3 additions and 1 deletions

View File

@ -123,6 +123,8 @@
currentMessage =
currentMessage.parentId !== null ? history.messages[currentMessage.parentId] : null;
}
// This is most likely causing the performance issue
messages = _messages;
} else {
messages = [];

View File

@ -58,7 +58,7 @@
Object.keys(history.messages).forEach((id) => {
const message = history.messages[id];
const level = message.parentId ? positionMap.get(message.parentId).level + 1 : 0;
const level = message.parentId ? (positionMap.get(message.parentId)?.level ?? -1) + 1 : 0;
if (!layerWidths[level]) layerWidths[level] = 0;
positionMap.set(id, {