mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: do not mutate update object reference
This commit is contained in:
@@ -117,9 +117,10 @@ export default (
|
||||
chats.upsert(...newChats)
|
||||
})
|
||||
ev.on('chats.update', updates => {
|
||||
for(const update of updates) {
|
||||
for(let update of updates) {
|
||||
const result = chats.update(update.id!, chat => {
|
||||
if(update.unreadCount > 0) {
|
||||
update = { ...update }
|
||||
update.unreadCount = chat.unreadCount + update.unreadCount
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user