diff --git a/src/renderer/appBadge.ts b/src/renderer/appBadge.ts index b55d488..26999a9 100644 --- a/src/renderer/appBadge.ts +++ b/src/renderer/appBadge.ts @@ -11,6 +11,7 @@ import { Settings } from "./settings"; let GuildReadStateStore: any; let NotificationSettingsStore: any; +let MessageRequestStore: any; export function setBadge() { if (Settings.store.appBadge === false) return; @@ -18,10 +19,11 @@ export function setBadge() { try { const mentionCount = GuildReadStateStore.getTotalMentionCount(); const pendingRequests = RelationshipStore.getPendingCount(); + const messageRequests = MessageRequestStore.getMessageRequestsCount(); const hasUnread = GuildReadStateStore.hasAnyUnread(); const disableUnreadBadge = NotificationSettingsStore.getDisableUnreadBadge(); - let totalCount = mentionCount + pendingRequests; + let totalCount = mentionCount + pendingRequests + messageRequests; if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1; VesktopNative.app.setBadgeCount(totalCount); @@ -44,4 +46,5 @@ function waitForAndSubscribeToStore(name: string, cb?: (m: any) => void) { waitForAndSubscribeToStore("GuildReadStateStore", store => (GuildReadStateStore = store)); waitForAndSubscribeToStore("NotificationSettingsStore", store => (NotificationSettingsStore = store)); +waitForAndSubscribeToStore("MessageRequestStore", store => (MessageRequestStore = store)); waitForAndSubscribeToStore("RelationshipStore");