fixed filter by tags + refactored search + bug fixed + settings page [WIP]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user