refac
This commit is contained in:
@@ -81,7 +81,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