mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
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:
commit
339697437a
@ -11,7 +11,7 @@ import {
|
|||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { api } from "@/utils/api";
|
import { api } from "@/utils/api";
|
||||||
import { Puzzle, RefreshCw } from "lucide-react";
|
import { Puzzle, RefreshCw } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -34,6 +34,16 @@ export const ShowConvertedCompose = ({ composeId }: Props) => {
|
|||||||
|
|
||||||
const { mutateAsync, isLoading } = api.compose.fetchSourceType.useMutation();
|
const { mutateAsync, isLoading } = api.compose.fetchSourceType.useMutation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isOpen) {
|
||||||
|
mutateAsync({ composeId })
|
||||||
|
.then(() => {
|
||||||
|
refetch();
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
}, [isOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
|
Loading…
Reference in New Issue
Block a user