Skip to content

Commit

Permalink
Fix for latest canary
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Oct 24, 2023
1 parent cac307d commit e6dc026
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/renderer/appBadge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ let NotificationSettingsStore: any;
export function setBadge() {
if (Settings.store.appBadge === false) return;

const mentionCount = GuildReadStateStore.getTotalMentionCount();
const pendingRequests = RelationshipStore.getPendingCount();
const hasUnread = GuildReadStateStore.hasAnyUnread();
const disableUnreadBadge = NotificationSettingsStore.getDisableUnreadBadge();

let totalCount = mentionCount + pendingRequests;
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;

VesktopNative.app.setBadgeCount(totalCount);
try {
const mentionCount = GuildReadStateStore.getTotalMentionCount();
const pendingRequests = RelationshipStore.getPendingCount();
const hasUnread = GuildReadStateStore.hasAnyUnread();
const disableUnreadBadge = NotificationSettingsStore.getDisableUnreadBadge();

let totalCount = mentionCount + pendingRequests;
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;

VesktopNative.app.setBadgeCount(totalCount);
} catch (e) {
console.error(e);
}
}

let toFind = 3;
Expand Down

0 comments on commit e6dc026

Please sign in to comment.