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