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)
|
chats.upsert(...newChats)
|
||||||
})
|
})
|
||||||
ev.on('chats.update', updates => {
|
ev.on('chats.update', updates => {
|
||||||
for(const update of updates) {
|
for(let update of updates) {
|
||||||
const result = chats.update(update.id!, chat => {
|
const result = chats.update(update.id!, chat => {
|
||||||
if(update.unreadCount > 0) {
|
if(update.unreadCount > 0) {
|
||||||
|
update = { ...update }
|
||||||
update.unreadCount = chat.unreadCount + update.unreadCount
|
update.unreadCount = chat.unreadCount + update.unreadCount
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user