diff --git a/app/(auth)/admin/mods/page.tsx b/app/(auth)/admin/mods/page.tsx index a931dc7..0ee3eaa 100644 --- a/app/(auth)/admin/mods/page.tsx +++ b/app/(auth)/admin/mods/page.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react"; import { useForm, SubmitHandler } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; -import { Button } from "@/components/ui/button"; +import { Button, buttonVariants } from "@/components/ui/button"; import { Form, FormControl, @@ -85,9 +85,9 @@ const SvrjsModsAdminPage = () => { downloadLink: editMod.downloadLink, fileSize: editMod.fileSize }); - setDialogOpen(true); // Open dialog when a mod is being edited } - }, [editMod, dialogForm]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [editMod, dialogForm.reset]); const fetchMods = async () => { try { @@ -130,7 +130,6 @@ const SvrjsModsAdminPage = () => { fetchMods(); setLoading(false); setEditMod(null); - setDialogOpen(false); // Close dialog on successful submission toast({ description: "Successfully Saved Changes" }); @@ -282,11 +281,14 @@ const SvrjsModsAdminPage = () => { {mod.fileSize} - - - + setEditMod(open ? mod : null)} + > + + Edit Edit Content