From 68e27adb029cb7bb7b51b8ea594163931a495c61 Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Sun, 2 Feb 2025 15:44:48 +0000
Subject: fix: Dont rearchive singlefile uploads and consider them as archives

---
 apps/web/components/dashboard/preview/LinkContentSection.tsx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

(limited to 'apps/web/components/dashboard/preview/LinkContentSection.tsx')

diff --git a/apps/web/components/dashboard/preview/LinkContentSection.tsx b/apps/web/components/dashboard/preview/LinkContentSection.tsx
index f09cc31f..f1fe3820 100644
--- a/apps/web/components/dashboard/preview/LinkContentSection.tsx
+++ b/apps/web/components/dashboard/preview/LinkContentSection.tsx
@@ -26,10 +26,12 @@ import {
 } from "@hoarder/shared/types/bookmarks";
 
 function FullPageArchiveSection({ link }: { link: ZBookmarkedLink }) {
+  const archiveAssetId =
+    link.fullPageArchiveAssetId ?? link.precrawledArchiveAssetId;
   return (
     <iframe
       title={link.url}
-      src={`/api/assets/${link.fullPageArchiveAssetId}`}
+      src={`/api/assets/${archiveAssetId}`}
       className="relative h-full min-w-full"
     />
   );
@@ -199,7 +201,10 @@ export default function LinkContentSection({
             </SelectItem>
             <SelectItem
               value="archive"
-              disabled={!bookmark.content.fullPageArchiveAssetId}
+              disabled={
+                !bookmark.content.fullPageArchiveAssetId &&
+                !bookmark.content.precrawledArchiveAssetId
+              }
             >
               {t("common.archive")}
             </SelectItem>
-- 
cgit v1.2.3-70-g09d2

