tab-seperated modals + eslint fix + much more bug fixed and improvements
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export default async function avatarExists(fileUrl: string): Promise<boolean> {
|
||||
const response = await fetch(fileUrl, { method: "HEAD" });
|
||||
return !(response.headers.get("content-type") === "text/plain");
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import useCollectionStore from "@/store/collections";
|
||||
import { useEffect } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import useTagStore from "@/store/tags";
|
||||
import useLinkStore from "@/store/links";
|
||||
import useAccountStore from "@/store/account";
|
||||
|
||||
export default function () {
|
||||
const { status, data } = useSession();
|
||||
const { setCollections } = useCollectionStore();
|
||||
const { setTags } = useTagStore();
|
||||
const { setLinks } = useLinkStore();
|
||||
const { setAccount } = useAccountStore();
|
||||
|
||||
useEffect(() => {
|
||||
if (status === "authenticated") {
|
||||
setCollections();
|
||||
setTags();
|
||||
setLinks();
|
||||
setAccount(data.user.email as string);
|
||||
}
|
||||
}, [status]);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export default async function (email: string) {
|
||||
export default async function getPublicUserDataByEmail(email: string) {
|
||||
const response = await fetch(`/api/routes/users?email=${email}`);
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
Reference in New Issue
Block a user