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/mobile/components/bookmarks/BookmarkCard.tsx | 8 ++------ apps/web/components/dashboard/bookmarks/BookmarkCard.tsx | 7 ++----- apps/web/components/dashboard/preview/BookmarkPreview.tsx | 8 ++------ 3 files changed, 6 insertions(+), 17 deletions(-) (limited to 'apps') diff --git a/apps/mobile/components/bookmarks/BookmarkCard.tsx b/apps/mobile/components/bookmarks/BookmarkCard.tsx index e4c2eee8..62e74e97 100644 --- a/apps/mobile/components/bookmarks/BookmarkCard.tsx +++ b/apps/mobile/components/bookmarks/BookmarkCard.tsx @@ -28,7 +28,7 @@ import { import { BookmarkTypes } from "@karakeep/shared/types/bookmarks"; import { getBookmarkLinkImageUrl, - isBookmarkStillLoading, + getBookmarkRefreshInterval, isBookmarkStillTagging, } from "@karakeep/shared/utils/bookmarkUtils"; @@ -432,11 +432,7 @@ export default function BookmarkCard({ if (!data) { return false; } - // If the link is not crawled or not tagged - if (isBookmarkStillLoading(data)) { - return 1000; - } - return false; + return getBookmarkRefreshInterval(data); }, }, ); 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