refac
This commit is contained in:
1 parent
b8ea267f8e
commit
58e78e8946
7 files changed
+24
-8
No files matched your search
@@ -163,7 +163,9 @@
|
||||
allChatsLoaded = newChatList.length === 0;
|
||||
|
||||
if (newChatList.length > 0) {
|
||||
chatList = [...chatList, ...newChatList];
|
||||
const existingIds = new Set(chatList.map((c) => c.id));
|
||||
const uniqueNewChats = newChatList.filter((c) => !existingIds.has(c.id));
|
||||
chatList = [...chatList, ...uniqueNewChats];
|
||||
}
|
||||
|
||||
chatListLoading = false;
|
||||
|
||||
Reference in new issue
Block a user