diff --git a/frontend/src/components/mii/author-buttons.tsx b/frontend/src/components/mii/author-buttons.tsx index c7f4840..7af8efc 100644 --- a/frontend/src/components/mii/author-buttons.tsx +++ b/frontend/src/components/mii/author-buttons.tsx @@ -1,16 +1,18 @@ import { Icon } from "@iconify/react"; import DeleteMiiButton from "./delete-mii-button"; import { Link } from "react-router"; +import { useStore } from "@nanostores/react"; +import { session } from "../../session"; interface Props { mii: any; } export default function AuthorButtons({ mii }: Props) { - // const session = useSession(); - - // if (!session.data || (Number(session.data.user?.id) !== mii.userId && Number(session.data.user?.id) !== Number(import.meta.env.NEXT_PUBLIC_ADMIN_USER_ID))) - // return null; + const $session = useStore(session); + if ($session === undefined) return null; + if ($session === null) return null; + if (Number($session?.user?.id) !== mii.userId && Number($session?.user?.id) !== Number(import.meta.env.VITE_ADMIN_USER_ID)) return null; return ( <> diff --git a/frontend/src/pages/edit.tsx b/frontend/src/pages/edit.tsx index 12a261b..885bd09 100644 --- a/frontend/src/pages/edit.tsx +++ b/frontend/src/pages/edit.tsx @@ -44,7 +44,7 @@ export default function EditMiiPage() { const [error, setError] = useState(undefined); const [name, setName] = useState(""); - const [tags, setTags] = useState([]); + const [tags, setTags] = useState([]); const [description, setDescription] = useState(""); const [gender, setGender] = useState("MALE"); const [makeup, setMakeup] = useState("PARTIAL");