Skip to content

Commit bb609b9

Browse files
committed
refactor: parallelize calls
1 parent 344ac52 commit bb609b9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/hooks/useNotifications.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,15 @@ export const useNotifications = (colors: boolean): NotificationsState => {
333333
(notification) => notification.repository.full_name === repoSlug,
334334
);
335335

336-
for (const notification of notificationsToRemove) {
337-
await markNotificationDone(
338-
accounts,
339-
notification.id,
340-
notifications[accountIndex].hostname,
341-
);
342-
}
336+
await Promise.all(
337+
notificationsToRemove.map((notification) =>
338+
markNotificationDone(
339+
accounts,
340+
notification.id,
341+
notifications[accountIndex].hostname,
342+
),
343+
),
344+
);
343345
}
344346

345347
const updatedNotifications = removeNotifications(

0 commit comments

Comments
 (0)