Fix for latest canary
This commit is contained in:
parent
cac307d1fc
commit
e6dc026708
1 changed files with 11 additions and 7 deletions
|
@ -15,15 +15,19 @@ let NotificationSettingsStore: any;
|
||||||
export function setBadge() {
|
export function setBadge() {
|
||||||
if (Settings.store.appBadge === false) return;
|
if (Settings.store.appBadge === false) return;
|
||||||
|
|
||||||
const mentionCount = GuildReadStateStore.getTotalMentionCount();
|
try {
|
||||||
const pendingRequests = RelationshipStore.getPendingCount();
|
const mentionCount = GuildReadStateStore.getTotalMentionCount();
|
||||||
const hasUnread = GuildReadStateStore.hasAnyUnread();
|
const pendingRequests = RelationshipStore.getPendingCount();
|
||||||
const disableUnreadBadge = NotificationSettingsStore.getDisableUnreadBadge();
|
const hasUnread = GuildReadStateStore.hasAnyUnread();
|
||||||
|
const disableUnreadBadge = NotificationSettingsStore.getDisableUnreadBadge();
|
||||||
|
|
||||||
let totalCount = mentionCount + pendingRequests;
|
let totalCount = mentionCount + pendingRequests;
|
||||||
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;
|
if (!totalCount && hasUnread && !disableUnreadBadge) totalCount = -1;
|
||||||
|
|
||||||
VesktopNative.app.setBadgeCount(totalCount);
|
VesktopNative.app.setBadgeCount(totalCount);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let toFind = 3;
|
let toFind = 3;
|
||||||
|
|
Loading…
Reference in a new issue