INNER CODE UNIT · TypeScript

applyUnreadBadge

elie222/inbox-zero · apps/desktop/src/main.ts:581

function applyUnreadBadge() {
  setUnreadBadge(Math.max(0, ...unreadByContents.values()));
}

function setUnreadBadge(count: number) {
  if (process.platform === "darwin")
    app.dock?.setBadge(count ? String(count) : "");
  else if (process.platform === "linux") app.setBadgeCount(count);
}

function clearMailIndicators() {
  unreadByContents.clear();
  applyUnreadBadge();
  for (const notification of mailNotifications.values()) notification.close();
  mailNotifications.clear();
}

function readLastAppUrl(): string | null {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…