From 5c225c8d42c5f6e62fa487d888e77d0f3e6d7ee1 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 30 Sep 2024 15:00:01 -0600 Subject: [PATCH] fix(modal): close the modal after the creation #509 --- apps/dokploy/components/dashboard/project/add-compose.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/dokploy/components/dashboard/project/add-compose.tsx b/apps/dokploy/components/dashboard/project/add-compose.tsx index 658bf0ae..91dba943 100644 --- a/apps/dokploy/components/dashboard/project/add-compose.tsx +++ b/apps/dokploy/components/dashboard/project/add-compose.tsx @@ -39,7 +39,7 @@ import { slugify } from "@/lib/slug"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; import { CircuitBoard, HelpCircle } from "lucide-react"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; @@ -71,6 +71,7 @@ interface Props { export const AddCompose = ({ projectId, projectName }: Props) => { const utils = api.useUtils(); + const [visible, setVisible] = useState(false); const slug = slugify(projectName); const { data: servers } = api.server.withSSHKey.useQuery(); const { mutateAsync, isLoading, error, isError } = @@ -101,6 +102,7 @@ export const AddCompose = ({ projectId, projectName }: Props) => { }) .then(async () => { toast.success("Compose Created"); + setVisible(false); await utils.project.one.invalidate({ projectId, }); @@ -111,7 +113,7 @@ export const AddCompose = ({ projectId, projectName }: Props) => { }; return ( - +