1- import log from 'electron-log' ;
21import { useCallback , useState } from 'react' ;
32import type {
43 Account ,
@@ -14,6 +13,7 @@ import {
1413 markNotificationThreadAsRead ,
1514} from '../utils/api/client' ;
1615import { isMarkAsDoneFeatureSupported } from '../utils/features' ;
16+ import { logError } from '../utils/logger' ;
1717import {
1818 getAllNotifications ,
1919 setTrayIconColor ,
@@ -121,8 +121,9 @@ export const useNotifications = (): NotificationsState => {
121121 setNotifications ( updatedNotifications ) ;
122122 setTrayIconColor ( updatedNotifications ) ;
123123 } catch ( err ) {
124- log . error (
125- '[markNotificationsAsRead]: Error occurred while marking notifications as read' ,
124+ logError (
125+ 'markNotificationsAsRead' ,
126+ 'Error occurred while marking notifications as read' ,
126127 err ,
127128 ) ;
128129 }
@@ -158,8 +159,9 @@ export const useNotifications = (): NotificationsState => {
158159 setNotifications ( updatedNotifications ) ;
159160 setTrayIconColor ( updatedNotifications ) ;
160161 } catch ( err ) {
161- log . error (
162- '[markNotificationsAsDone]: error occurred while marking notifications as done' ,
162+ logError (
163+ 'markNotificationsAsDone' ,
164+ 'Error occurred while marking notifications as done' ,
163165 err ,
164166 ) ;
165167 }
@@ -186,9 +188,11 @@ export const useNotifications = (): NotificationsState => {
186188 await markNotificationsAsRead ( state , [ notification ] ) ;
187189 }
188190 } catch ( err ) {
189- log . error (
190- '[unsubscribeNotification]: error occurred while unsubscribing from notification thread' ,
191+ logError (
192+ 'unsubscribeNotification' ,
193+ 'Error occurred while unsubscribing from notification thread' ,
191194 err ,
195+ notification ,
192196 ) ;
193197 }
194198
0 commit comments