@@ -44,7 +44,8 @@ import {
4444 setAlternateIdleIcon ,
4545 setAutoLaunch ,
4646 setKeyboardShortcut ,
47- setTrayIconStatusColors ,
47+ setMonochromeIcon ,
48+ updateTrayIcon ,
4849 updateTrayTitle ,
4950} from '../utils/comms' ;
5051import { getNotificationCount } from '../utils/notifications/notifications' ;
@@ -158,6 +159,22 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
158159 }
159160 } , [ settings . showNotificationsCountInTray , notifications ] ) ;
160161
162+ useEffect ( ( ) => {
163+ const count = getNotificationCount ( notifications ) ;
164+
165+ setMonochromeIcon ( settings . useMonochromeIcon ) ;
166+
167+ updateTrayIcon ( count ) ;
168+ } , [ settings . useMonochromeIcon , notifications ] ) ;
169+
170+ useEffect ( ( ) => {
171+ setAutoLaunch ( settings . openAtStartup ) ;
172+ } , [ settings . openAtStartup ] ) ;
173+
174+ useEffect ( ( ) => {
175+ setAlternateIdleIcon ( settings . useAlternateIdleIcon ) ;
176+ } , [ settings . useAlternateIdleIcon ] ) ;
177+
161178 useEffect ( ( ) => {
162179 setKeyboardShortcut ( settings . keyboardShortcut ) ;
163180 } , [ settings . keyboardShortcut ] ) ;
@@ -183,18 +200,6 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
183200
184201 const updateSetting = useCallback (
185202 ( name : keyof SettingsState , value : SettingsValue ) => {
186- if ( name === 'openAtStartup' ) {
187- setAutoLaunch ( value as boolean ) ;
188- }
189-
190- if ( name === 'trayIconStatusColors' ) {
191- setTrayIconStatusColors ( value as boolean ) ;
192- }
193-
194- if ( name === 'useAlternateIdleIcon' ) {
195- setAlternateIdleIcon ( value as boolean ) ;
196- }
197-
198203 const newSettings = { ...settings , [ name ] : value } ;
199204 setSettings ( newSettings ) ;
200205 saveState ( { auth, settings : newSettings } ) ;
@@ -273,6 +278,7 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
273278 // Restore settings before accounts to ensure filters are available before fetching notifications
274279 if ( existing . settings ) {
275280 setKeyboardShortcut ( existing . settings . keyboardShortcut ) ;
281+ setMonochromeIcon ( existing . settings . useMonochromeIcon ) ;
276282 setAlternateIdleIcon ( existing . settings . useAlternateIdleIcon ) ;
277283 setSettings ( { ...defaultSettings , ...existing . settings } ) ;
278284 window . gitify . zoom . setLevel (
0 commit comments