From ccc48df07efb6cdd5dc62606f54379a99197fc44 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 20 Mar 2024 14:54:28 +0100 Subject: [PATCH] fix(MessagesList): cycle through only existing group keys when soft updating Signed-off-by: Maksim Sukharev --- src/components/MessagesList/MessagesList.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MessagesList/MessagesList.vue b/src/components/MessagesList/MessagesList.vue index 58c9778cd0f3..e83128c4c750 100644 --- a/src/components/MessagesList/MessagesList.vue +++ b/src/components/MessagesList/MessagesList.vue @@ -431,10 +431,10 @@ export default { }, softUpdateAuthorGroups(oldGroups, newGroups, dateTimestamp) { - const oldKeys = Object.keys(oldGroups) Object.entries(newGroups).forEach(([id, newGroup]) => { if (!oldGroups[id]) { - const oldId = oldKeys.find(key => id < key && oldGroups[key].nextMessageId <= newGroup.nextMessageId) + const oldId = Object.keys(oldGroups) + .find(key => id < key && oldGroups[key].nextMessageId <= newGroup.nextMessageId) if (oldId) { // newGroup includes oldGroup and more old messages, remove oldGroup delete this.messagesGroupedByDateByAuthor[dateTimestamp][oldId]