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:
parent
24db4006cf
commit
06b58e6495
@ -41,8 +41,10 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
|
||||
};
|
||||
|
||||
return () => {
|
||||
ws.close();
|
||||
wsRef.current = null;
|
||||
if (wsRef.current?.readyState === WebSocket.OPEN) {
|
||||
ws.close();
|
||||
wsRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [logPath, open]);
|
||||
|
||||
@ -62,7 +64,9 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
|
||||
if (!e) setData("");
|
||||
|
||||
if (!e && wsRef.current) {
|
||||
wsRef.current.close(); // Close WebSocket when modal closes
|
||||
if (wsRef.current.readyState === WebSocket.OPEN) {
|
||||
wsRef.current.close();
|
||||
}
|
||||
setData("");
|
||||
}
|
||||
}}
|
||||
|
Loading…
Reference in New Issue
Block a user