diff options
Diffstat (limited to 'apps/web/lib/bulkActions.ts')
| -rw-r--r-- | apps/web/lib/bulkActions.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/web/lib/bulkActions.ts b/apps/web/lib/bulkActions.ts index 34a236c6..ef814331 100644 --- a/apps/web/lib/bulkActions.ts +++ b/apps/web/lib/bulkActions.ts @@ -2,6 +2,7 @@ import { create } from "zustand"; import type { ZBookmark } from "@karakeep/shared/types/bookmarks"; +import { ZBookmarkList } from "@karakeep/shared/types/lists"; interface BookmarkState { selectedBookmarks: ZBookmark[]; @@ -13,12 +14,15 @@ interface BookmarkState { selectAll: () => void; unSelectAll: () => void; isEverythingSelected: () => boolean; + setListContext: (listContext: ZBookmarkList | undefined) => void; + listContext: ZBookmarkList | undefined; } const useBulkActionsStore = create<BookmarkState>((set, get) => ({ selectedBookmarks: [], visibleBookmarks: [], isBulkEditEnabled: false, + listContext: undefined, toggleBookmark: (bookmark: ZBookmark) => { const selectedBookmarks = get().selectedBookmarks; @@ -57,6 +61,9 @@ const useBulkActionsStore = create<BookmarkState>((set, get) => ({ visibleBookmarks, }); }, + setListContext: (listContext: ZBookmarkList | undefined) => { + set({ listContext }); + }, })); export default useBulkActionsStore; |
