File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -156,21 +156,23 @@ export const useNotifications = (): NotificationsState => {
156156
157157 const markNotificationsAsDone = useCallback (
158158 async ( state : GitifyState , doneNotifications : Notification [ ] ) => {
159+ if ( ! isMarkAsDoneFeatureSupported ( doneNotifications [ 0 ] . account ) ) {
160+ return ;
161+ }
162+
159163 setStatus ( 'loading' ) ;
160164
161165 try {
162- if ( isMarkAsDoneFeatureSupported ( doneNotifications [ 0 ] . account ) ) {
163- await Promise . all (
164- doneNotifications . map ( ( notification ) =>
165- markNotificationThreadAsDone (
166- notification . id ,
167- notification . account . hostname ,
168- notification . account . token ,
169- ) ,
166+ await Promise . all (
167+ doneNotifications . map ( ( notification ) =>
168+ markNotificationThreadAsDone (
169+ notification . id ,
170+ notification . account . hostname ,
171+ notification . account . token ,
170172 ) ,
171- ) ;
172- }
173-
173+ ) ,
174+ ) ;
175+
174176 const updatedNotifications = removeNotifications (
175177 state . settings ,
176178 doneNotifications ,
You can’t perform that action at this time.
0 commit comments