Skip to content

Commit fc59a90

Browse files
committed
simplify
Signed-off-by: Markus Stoll <[email protected]>
1 parent dbce785 commit fc59a90

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/talk/renderer/TalkWrapper/TalkWrapper.vue

+2-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { registerTalkDesktopSettingsSection } from '../Settings/index.ts'
1010
import { subscribeBroadcast } from '../../../shared/broadcast.service.ts'
1111
import { appData } from '../../../app/AppData.js'
1212
import { subscribe } from '@nextcloud/event-bus'
13-
import { EVENTS } from '@talk/src/constants.ts'
1413

1514
const emit = defineEmits<{
1615
(event: 'ready'): void
@@ -36,14 +35,8 @@ onMounted(async () => {
3635
appData.setTalkHashDirty(true).persist()
3736
})
3837

39-
subscribe(EVENTS.UNREAD_COUNT_UPDATED, (eventData) => {
40-
// Process unread counter values
41-
const { totalUnreadMessages, totalUnreadMentions, totalUnreadMentionsDirect } = eventData
42-
43-
if (window.TALK_DESKTOP) {
44-
const badgeCount = totalUnreadMessages
45-
window.TALK_DESKTOP.setBadgeCount(badgeCount)
46-
}
38+
subscribe('talk:unread:updated', ( eventData ) => {
39+
window.TALK_DESKTOP.setBadgeCount(eventData.messages)
4740
})
4841

4942
// Ready

0 commit comments

Comments
 (0)