From 18c1d15e84b69112861e1560e9285dba3d95e43d Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 31 Aug 2025 16:51:15 +0000 Subject: fix: Incremental polling interval for ongoing crawls --- apps/web/components/dashboard/bookmarks/BookmarkCard.tsx | 7 ++----- apps/web/components/dashboard/preview/BookmarkPreview.tsx | 8 ++------ 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'apps/web/components') diff --git a/apps/web/components/dashboard/bookmarks/BookmarkCard.tsx b/apps/web/components/dashboard/bookmarks/BookmarkCard.tsx index 4fc7d94a..595a9e00 100644 --- a/apps/web/components/dashboard/bookmarks/BookmarkCard.tsx +++ b/apps/web/components/dashboard/bookmarks/BookmarkCard.tsx @@ -1,7 +1,7 @@ import { api } from "@/lib/trpc"; import { BookmarkTypes, ZBookmark } from "@karakeep/shared/types/bookmarks"; -import { isBookmarkStillLoading } from "@karakeep/shared/utils/bookmarkUtils"; +import { getBookmarkRefreshInterval } from "@karakeep/shared/utils/bookmarkUtils"; import AssetCard from "./AssetCard"; import LinkCard from "./LinkCard"; @@ -26,10 +26,7 @@ export default function BookmarkCard({ if (!data) { return false; } - if (isBookmarkStillLoading(data)) { - return 1000; - } - return false; + return getBookmarkRefreshInterval(data); }, }, ); diff --git a/apps/web/components/dashboard/preview/BookmarkPreview.tsx b/apps/web/components/dashboard/preview/BookmarkPreview.tsx index 01c86f6e..4766bd32 100644 --- a/apps/web/components/dashboard/preview/BookmarkPreview.tsx +++ b/apps/web/components/dashboard/preview/BookmarkPreview.tsx @@ -20,10 +20,10 @@ import { Building, CalendarDays, ExternalLink, User } from "lucide-react"; import { BookmarkTypes, ZBookmark } from "@karakeep/shared/types/bookmarks"; import { + getBookmarkRefreshInterval, getBookmarkTitle, getSourceUrl, isBookmarkStillCrawling, - isBookmarkStillLoading, } from "@karakeep/shared/utils/bookmarkUtils"; import SummarizeBookmarkArea from "../bookmarks/SummarizeBookmarkArea"; @@ -129,11 +129,7 @@ export default function BookmarkPreview({ if (!data) { return false; } - // If the link is not crawled or not tagged - if (isBookmarkStillLoading(data)) { - return 1000; - } - return false; + return getBookmarkRefreshInterval(data); }, }, ); -- cgit v1.2.3-70-g09d2