mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-03-03 03:47:02 +00:00
bug fix
This commit is contained in:
@@ -162,6 +162,11 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse) {
|
||||
},
|
||||
},
|
||||
url,
|
||||
|
||||
// temporarily prevent archiveHandler and other processes from overwriting the file while we're uploading it
|
||||
lastPreserved: new Date(0).toISOString(),
|
||||
aiTagged: true,
|
||||
indexVersion: 1,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -203,6 +208,10 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse) {
|
||||
: undefined,
|
||||
clientSide: true,
|
||||
updatedAt: new Date().toISOString(),
|
||||
|
||||
lastPreserved: null,
|
||||
aiTagged: false,
|
||||
indexVersion: null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export default async function archiveHandler(
|
||||
await page.goto(link.url, { waitUntil: "domcontentloaded" });
|
||||
|
||||
// Handle Monolith being sent in beforehand while making sure other values line up
|
||||
if (link.monolith) {
|
||||
if (link.monolith?.endsWith(".html")) {
|
||||
// Use Monolith content instead of page
|
||||
const file = await readFile(link.monolith);
|
||||
|
||||
@@ -128,9 +128,13 @@ export default async function archiveHandler(
|
||||
const fileContent = file.file;
|
||||
|
||||
if (typeof fileContent === "string") {
|
||||
await page.setContent(fileContent, { waitUntil: "domcontentloaded" });
|
||||
await page.setContent(fileContent, {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
} else {
|
||||
await page.setContent(fileContent.toString("utf-8"), { waitUntil: "domcontentloaded" });
|
||||
await page.setContent(fileContent.toString("utf-8"), {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user