mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-11 14:35:17 +00:00
fix: preserve selected stack log container
This commit is contained in:
@@ -72,16 +72,19 @@ export const ShowDockerLogsStack = ({
|
|||||||
const containers = data?.filter((container) => container.containerId);
|
const containers = data?.filter((container) => container.containerId);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (option === "native") {
|
const currentContainers = option === "native" ? containers : services;
|
||||||
if (containers && containers?.length > 0) {
|
|
||||||
setContainerId(containers[0]?.containerId);
|
if (
|
||||||
}
|
currentContainers &&
|
||||||
} else {
|
currentContainers.length > 0 &&
|
||||||
if (services && services?.length > 0) {
|
(!containerId ||
|
||||||
setContainerId(services[0]?.containerId);
|
!currentContainers.some(
|
||||||
}
|
(container) => container.containerId === containerId,
|
||||||
|
))
|
||||||
|
) {
|
||||||
|
setContainerId(currentContainers[0]?.containerId);
|
||||||
}
|
}
|
||||||
}, [option, services, containers]);
|
}, [option, services, containers, containerId]);
|
||||||
|
|
||||||
const isLoading = option === "native" ? containersLoading : servicesLoading;
|
const isLoading = option === "native" ? containersLoading : servicesLoading;
|
||||||
const containersLength =
|
const containersLength =
|
||||||
|
|||||||
Reference in New Issue
Block a user