mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: close connection ws
This commit is contained in:
@@ -41,8 +41,10 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
ws.close();
|
if (wsRef.current?.readyState === WebSocket.OPEN) {
|
||||||
wsRef.current = null;
|
ws.close();
|
||||||
|
wsRef.current = null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, [logPath, open]);
|
}, [logPath, open]);
|
||||||
|
|
||||||
@@ -62,7 +64,9 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
|
|||||||
if (!e) setData("");
|
if (!e) setData("");
|
||||||
|
|
||||||
if (!e && wsRef.current) {
|
if (!e && wsRef.current) {
|
||||||
wsRef.current.close(); // Close WebSocket when modal closes
|
if (wsRef.current.readyState === WebSocket.OPEN) {
|
||||||
|
wsRef.current.close();
|
||||||
|
}
|
||||||
setData("");
|
setData("");
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user