added support for getting scripts from cache

This commit is contained in:
Bram Suurd
2024-07-29 23:43:28 +02:00
parent 8a5c2dce35
commit 2d172233ee

View File

@@ -50,7 +50,12 @@ export default function Page() {
throw new Error("Empty response");
}
} catch (error) {
console.error("Error fetching links from pb:", error);
const cachedLinks = localStorage.getItem("scripts");
if (cachedLinks) {
res = JSON.parse(cachedLinks);
} else {
throw error;
}
throw error;
}
res = res.sort((a: Category, b: Category) => {