fixed filter by tags + refactored search + bug fixed + settings page [WIP]

This commit is contained in:
daniel31x13
2023-10-16 13:10:52 -04:00
parent 36a1ed209e
commit f98500ec4e
22 changed files with 561 additions and 184 deletions
+10 -1
View File
@@ -1,4 +1,13 @@
const avatarCache = new Map();
export default async function avatarExists(fileUrl: string): Promise<boolean> {
if (avatarCache.has(fileUrl)) {
return avatarCache.get(fileUrl);
}
const response = await fetch(fileUrl, { method: "HEAD" });
return !(response.headers.get("content-type") === "text/html");
const exists = !(response.headers.get("content-type") === "text/html");
avatarCache.set(fileUrl, exists);
return exists;
}