Skip to content

Commit 1fad0bb

Browse files
authored
Update useNotifications.ts
1 parent fb7f57a commit 1fad0bb

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/renderer/hooks/useNotifications.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)