Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(soup): bulk marking emails as done happens in parallel (#2675)

teoc21181d9a791
diff --git a/js/app/packages/app/component/next-soup/actions/make-mark-done-action.ts b/js/app/packages/app/component/next-soup/actions/make-mark-done-action.ts
index 72a7c0689e..789014b8e9 100644
--- a/js/app/packages/app/component/next-soup/actions/make-mark-done-action.ts
+++ b/js/app/packages/app/component/next-soup/actions/make-mark-done-action.ts
@@ -34,16 +34,18 @@ export const makeMarkDoneAction = (options: MakeMarkDoneOptions) => {
const execute = async (entities: EntityData[]) => {
const source = notificationSource();
- for (const entity of entities) {
- if (entity.type === 'email') {
- await archiveEmail(entity.id, {
- archive: true,
- optimisticallyExclude: true,
- });
- }
+ await Promise.all(
+ entities.map(async (entity) => {
+ if (entity.type === 'email') {
+ await archiveEmail(entity.id, {
+ archive: true,
+ optimisticallyExclude: true,
+ });
+ }
- markNotificationsForEntityAsDone(source, entity);
- }
+ markNotificationsForEntityAsDone(source, entity);
+ })
+ );
toast.success(
entities.length > 1