fix initial `count`
This commit is contained in:
parent
893d08f8ae
commit
0ced78661c
|
@ -44,13 +44,18 @@ export class ActivityCenter {
|
|||
const chatUuid = notification.value.chatUuid
|
||||
|
||||
const chat = unreadChats.get(chatUuid)
|
||||
if (chat) {
|
||||
const shouldIncrement = notification.isMention || notification.isReply
|
||||
if (shouldIncrement) {
|
||||
chat.count++
|
||||
let count = chat?.count ?? 0
|
||||
|
||||
if (notification.isMention || notification.isReply) {
|
||||
count++
|
||||
}
|
||||
|
||||
console.log('be:count', count)
|
||||
|
||||
if (chat) {
|
||||
chat.count = count
|
||||
} else {
|
||||
unreadChats.set(chatUuid, { count: 0 })
|
||||
unreadChats.set(chatUuid, { count })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue