From 9829e8eb7f16a3ba1b95cd589087963258fa2290 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 09:15:57 +0000 Subject: [PATCH] Fix "Show Notifications" menu item and backend logic - Enabled the "Show Notifications" menu item in `source/menu.ts` by removing `visible: is.development`. - Updated `source/browser/conversation-list.ts` to respect the `notificationsMuted` configuration setting in `countUnread`. - Removed obsolete TODO comments. --- source/browser/conversation-list.ts | 6 ++++++ source/menu.ts | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/browser/conversation-list.ts b/source/browser/conversation-list.ts index 1aaed22..adc42a8 100644 --- a/source/browser/conversation-list.ts +++ b/source/browser/conversation-list.ts @@ -1,6 +1,7 @@ import {ipcRenderer as ipc} from 'electron-better-ipc'; import elementReady from 'element-ready'; import selectors from './selectors'; +import config from '../config'; const icon = { read: 'data-caprine-icon', @@ -257,6 +258,11 @@ export async function sendConversationList(): Promise { const knownUnreadMessages = new Map(); function countUnread(mutationsList: MutationRecord[]): void { + // Check if notifications are muted + if (config.get('notificationsMuted')) { + return; + } + const processedHrefs = new Set(); for (const mutation of mutationsList) { diff --git a/source/menu.ts b/source/menu.ts index aa6f59c..1b28afe 100644 --- a/source/menu.ts +++ b/source/menu.ts @@ -282,12 +282,8 @@ Press Command/Ctrl+R in Caprine to see your changes. }, }, { - // TODO: Fix notifications. - // ESTABLISHED FIX: Notifications are now handled by the robust mutation observer in `source/browser/conversation-list.ts`. - // This menu item logic handles the state toggle which is verified to work with the new preference toggle logic. label: 'Show Notifications', type: 'checkbox', - visible: is.development, checked: !config.get('notificationsMuted'), click(menuItem) { config.set('notificationsMuted', !menuItem.checked); @@ -417,7 +413,8 @@ Press Command/Ctrl+R in Caprine to see your changes. dialog.showMessageBox({ type: 'info', message: 'Press the Alt key to toggle the menu bar.', - buttons: ['OK'], + buttons: [ + 'OK'], }); } },