aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-03-09 15:34:24 +0000
committerMohamed Bassem <me@mbassem.com>2025-03-09 21:38:51 +0000
commit82ca8e3a55f26a8709251f161224e92b93fc5828 (patch)
treedd42d6150e766fe4f51927044a966c6f496705ee /apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx
parentdbe6c1de20bc38e54c848983d75c861be288dfe1 (diff)
downloadkarakeep-82ca8e3a55f26a8709251f161224e92b93fc5828.tar.zst
fix: Add error boundary around bookmark cards
Diffstat (limited to 'apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx')
-rw-r--r--apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx b/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx
index bb3222a7..b8e8d1e6 100644
--- a/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx
+++ b/apps/web/components/dashboard/bookmarks/BookmarksGrid.tsx
@@ -7,6 +7,7 @@ import {
} from "@/lib/userLocalSettings/bookmarksLayout";
import tailwindConfig from "@/tailwind.config";
import { Slot } from "@radix-ui/react-slot";
+import { ErrorBoundary } from "react-error-boundary";
import { useInView } from "react-intersection-observer";
import Masonry from "react-masonry-css";
import resolveConfig from "tailwindcss/resolveConfig";
@@ -15,6 +16,7 @@ import type { ZBookmark } from "@hoarder/shared/types/bookmarks";
import BookmarkCard from "./BookmarkCard";
import EditorCard from "./EditorCard";
+import UnknownCard from "./UnknownCard";
function StyledBookmarkCard({ children }: { children: React.ReactNode }) {
return (
@@ -78,9 +80,11 @@ export default function BookmarksGrid({
</StyledBookmarkCard>
),
...bookmarks.map((b) => (
- <StyledBookmarkCard key={b.id}>
- <BookmarkCard bookmark={b} />
- </StyledBookmarkCard>
+ <ErrorBoundary key={b.id} fallback={<UnknownCard bookmark={b} />}>
+ <StyledBookmarkCard>
+ <BookmarkCard bookmark={b} />
+ </StyledBookmarkCard>
+ </ErrorBoundary>
)),
];
return (