diff --git a/components/ModalContent/NewLinkModal.tsx b/components/ModalContent/NewLinkModal.tsx
index 50288f8..03deba0 100644
--- a/components/ModalContent/NewLinkModal.tsx
+++ b/components/ModalContent/NewLinkModal.tsx
@@ -25,9 +25,10 @@ export default function NewLinkModal({ onClose }: Props) {
description: "",
type: "url",
tags: [],
- screenshotPath: "",
- pdfPath: "",
- readabilityPath: "",
+ preview: "",
+ image: "",
+ pdf: "",
+ readable: "",
textContent: "",
collection: {
name: "",
diff --git a/components/ModalContent/PreservedFormatsModal.tsx b/components/ModalContent/PreservedFormatsModal.tsx
index 3a4929b..b9b51c6 100644
--- a/components/ModalContent/PreservedFormatsModal.tsx
+++ b/components/ModalContent/PreservedFormatsModal.tsx
@@ -70,12 +70,12 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
const isReady = () => {
return (
collectionOwner.archiveAsScreenshot ===
- (link && link.pdfPath && link.pdfPath !== "pending") &&
+ (link && link.pdf && link.pdf !== "pending") &&
collectionOwner.archiveAsPDF ===
- (link && link.pdfPath && link.pdfPath !== "pending") &&
+ (link && link.pdf && link.pdf !== "pending") &&
link &&
- link.readabilityPath &&
- link.readabilityPath !== "pending"
+ link.readable &&
+ link.readable !== "pending"
);
};
@@ -107,7 +107,7 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
clearInterval(interval);
}
};
- }, [link?.screenshotPath, link?.pdfPath, link?.readabilityPath]);
+ }, [link?.image, link?.pdf, link?.readable]);
const updateArchive = async () => {
const load = toast.loading("Sending request...");
@@ -154,7 +154,7 @@ export default function PreservedFormatsModal({ onClose, activeLink }: Props) {
name={"Screenshot"}
icon={"bi-file-earmark-image"}
format={
- link?.screenshotPath?.endsWith("png")
+ link?.image?.endsWith("png")
? ArchivedFormat.png
: ArchivedFormat.jpeg
}
diff --git a/components/ModalContent/UploadFileModal.tsx b/components/ModalContent/UploadFileModal.tsx
index f45f40d..497bc91 100644
--- a/components/ModalContent/UploadFileModal.tsx
+++ b/components/ModalContent/UploadFileModal.tsx
@@ -27,9 +27,10 @@ export default function UploadFileModal({ onClose }: Props) {
description: "",
type: "url",
tags: [],
- screenshotPath: "",
- pdfPath: "",
- readabilityPath: "",
+ preview: "",
+ image: "",
+ pdf: "",
+ readable: "",
textContent: "",
collection: {
name: "",
diff --git a/components/PreserverdFormatRow.tsx b/components/PreserverdFormatRow.tsx
index 393bee8..d88ec90 100644
--- a/components/PreserverdFormatRow.tsx
+++ b/components/PreserverdFormatRow.tsx
@@ -43,7 +43,7 @@ export default function PreservedFormatRow({
})();
let interval: any;
- if (link?.screenshotPath === "pending" || link?.pdfPath === "pending") {
+ if (link?.image === "pending" || link?.pdf === "pending") {
interval = setInterval(async () => {
const data = await getLink(link.id as number, isPublic);
setLink(
@@ -61,7 +61,7 @@ export default function PreservedFormatRow({
clearInterval(interval);
}
};
- }, [link?.screenshotPath, link?.pdfPath, link?.readabilityPath]);
+ }, [link?.image, link?.pdf, link?.readable]);
const handleDownload = () => {
const path = `/api/v1/archives/${link?.id}?format=${format}`;
diff --git a/components/ReadableView.tsx b/components/ReadableView.tsx
index 92ad9a0..f8eb3b6 100644
--- a/components/ReadableView.tsx
+++ b/components/ReadableView.tsx
@@ -62,12 +62,12 @@ export default function ReadableView({ link }: Props) {
let interval: any;
if (
link &&
- (link?.screenshotPath === "pending" ||
- link?.pdfPath === "pending" ||
- link?.readabilityPath === "pending" ||
- !link?.screenshotPath ||
- !link?.pdfPath ||
- !link?.readabilityPath)
+ (link?.image === "pending" ||
+ link?.pdf === "pending" ||
+ link?.readable === "pending" ||
+ !link?.image ||
+ !link?.pdf ||
+ !link?.readable)
) {
interval = setInterval(() => getLink(link.id as number), 5000);
} else {
@@ -81,7 +81,7 @@ export default function ReadableView({ link }: Props) {
clearInterval(interval);
}
};
- }, [link?.screenshotPath, link?.pdfPath, link?.readabilityPath]);
+ }, [link?.image, link?.pdf, link?.readable]);
const rgbToHex = (r: number, g: number, b: number): string =>
"#" +
@@ -225,7 +225,7 @@ export default function ReadableView({ link }: Props) {
- {link?.readabilityPath?.startsWith("archives") ? (
+ {link?.readable?.startsWith("archives") ? (