@@ -19,7 +19,7 @@ import { rendererLogError } from '../utils/logger';
1919import { triggerNativeNotifications } from '../utils/notifications/native' ;
2020import {
2121 getAllNotifications ,
22- setTrayIconColor ,
22+ setTrayIconColorAndTitle ,
2323} from '../utils/notifications/notifications' ;
2424import { removeNotifications } from '../utils/notifications/remove' ;
2525
@@ -34,9 +34,13 @@ function markNotificationsAsReadLocally(targetNotifications: Notification[]) {
3434}
3535
3636interface NotificationsState {
37+ status : Status ;
38+ globalError : GitifyError ;
39+
3740 notifications : AccountNotifications [ ] ;
38- removeAccountNotifications : ( account : Account ) => Promise < void > ;
3941 fetchNotifications : ( state : GitifyState ) => Promise < void > ;
42+ removeAccountNotifications : ( account : Account ) => Promise < void > ;
43+
4044 markNotificationsAsRead : (
4145 state : GitifyState ,
4246 notifications : Notification [ ] ,
@@ -49,8 +53,6 @@ interface NotificationsState {
4953 state : GitifyState ,
5054 notification : Notification ,
5155 ) => Promise < void > ;
52- status : Status ;
53- globalError : GitifyError ;
5456}
5557
5658export const useNotifications = ( ) : NotificationsState => {
@@ -70,7 +72,7 @@ export const useNotifications = (): NotificationsState => {
7072 ) ;
7173
7274 setNotifications ( updatedNotifications ) ;
73- setTrayIconColor ( updatedNotifications ) ;
75+
7476 setStatus ( 'success' ) ;
7577 } ,
7678 [ notifications ] ,
@@ -109,6 +111,7 @@ export const useNotifications = (): NotificationsState => {
109111
110112 setNotifications ( fetchedNotifications ) ;
111113 triggerNativeNotifications ( notifications , fetchedNotifications , state ) ;
114+
112115 setStatus ( 'success' ) ;
113116 } ,
114117 [ notifications ] ,
@@ -138,7 +141,7 @@ export const useNotifications = (): NotificationsState => {
138141 markNotificationsAsReadLocally ( readNotifications ) ;
139142
140143 setNotifications ( updatedNotifications ) ;
141- setTrayIconColor ( updatedNotifications ) ;
144+ setTrayIconColorAndTitle ( updatedNotifications , state . settings ) ;
142145 } catch ( err ) {
143146 rendererLogError (
144147 'markNotificationsAsRead' ,
@@ -180,7 +183,7 @@ export const useNotifications = (): NotificationsState => {
180183 markNotificationsAsReadLocally ( doneNotifications ) ;
181184
182185 setNotifications ( updatedNotifications ) ;
183- setTrayIconColor ( updatedNotifications ) ;
186+ setTrayIconColorAndTitle ( updatedNotifications , state . settings ) ;
184187 } catch ( err ) {
185188 rendererLogError (
186189 'markNotificationsAsDone' ,
0 commit comments