mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-09 21:45:17 +00:00
fix: clear stale stack log container selection
This commit is contained in:
@@ -74,15 +74,16 @@ export const ShowDockerLogsStack = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentContainers = option === "native" ? containers : services;
|
const currentContainers = option === "native" ? containers : services;
|
||||||
|
|
||||||
if (
|
if (currentContainers) {
|
||||||
currentContainers &&
|
const nextContainerId = currentContainers.some(
|
||||||
currentContainers.length > 0 &&
|
(container) => container.containerId === containerId,
|
||||||
(!containerId ||
|
)
|
||||||
!currentContainers.some(
|
? containerId
|
||||||
(container) => container.containerId === containerId,
|
: currentContainers[0]?.containerId;
|
||||||
))
|
|
||||||
) {
|
if (nextContainerId !== containerId) {
|
||||||
setContainerId(currentContainers[0]?.containerId);
|
setContainerId(nextContainerId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [option, services, containers, containerId]);
|
}, [option, services, containers, containerId]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user