better profile photo update logic

This commit is contained in:
Daniel
2023-06-08 17:09:22 +03:30
parent 39abb09002
commit dcdef77387
5 changed files with 31 additions and 53 deletions
-4
View File
@@ -1,4 +0,0 @@
export default async function avatarExists(fileUrl: string): Promise<boolean> {
const response = await fetch(fileUrl, { method: "HEAD" });
return !(response.headers.get("content-type") === "text/plain");
}