Merge pull request #544 from Dokploy/533-the-traefik-labels-get-duplicated-if-i-have-two-services-and-two-domains-in-one-docker-compose-file

fix(compose): refetch compose file when enter to the modal to prevent…
This commit is contained in:
Mauricio Siu 2024-10-12 16:26:43 -06:00 committed by GitHub
commit 339697437a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ import {
} from "@/components/ui/dialog";
import { api } from "@/utils/api";
import { Puzzle, RefreshCw } from "lucide-react";
import { useState } from "react";
import { useEffect, useState } from "react";
import { toast } from "sonner";
interface Props {
@ -34,6 +34,16 @@ export const ShowConvertedCompose = ({ composeId }: Props) => {
const { mutateAsync, isLoading } = api.compose.fetchSourceType.useMutation();
useEffect(() => {
if (isOpen) {
mutateAsync({ composeId })
.then(() => {
refetch();
})
.catch((err) => {});
}
}, [isOpen]);
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>