aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx')
-rw-r--r--apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx b/apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx
index 9c1f05d2..27e5c5e2 100644
--- a/apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx
+++ b/apps/web/components/dashboard/bookmarks/BulkManageListsModal.tsx
@@ -21,6 +21,7 @@ import { useForm } from "react-hook-form";
import { z } from "zod";
import { useAddBookmarkToList } from "@hoarder/shared-react/hooks/lists";
+import { limitConcurrency } from "@hoarder/shared/concurrency";
import { BookmarkListSelector } from "../lists/BookmarkListSelector";
@@ -67,11 +68,15 @@ export default function BulkManageListsModal({
const onSubmit = async (value: z.infer<typeof formSchema>) => {
const results = await Promise.allSettled(
- bookmarkIds.map((bookmarkId) =>
- addToList({
- bookmarkId,
- listId: value.listId,
- }),
+ limitConcurrency(
+ bookmarkIds.map(
+ (bookmarkId) => () =>
+ addToList({
+ bookmarkId,
+ listId: value.listId,
+ }),
+ ),
+ 50,
),
);