fix(formModal): remove connectWS from dependencies array in useEffect to prevent unnecessary reconnections
fix(formModal): remove connectWS from dependencies array in useEffect to prevent unnecessary reconnections
This commit is contained in:
parent
7a7efc2afa
commit
96b432d127
1 changed files with 4 additions and 2 deletions
|
|
@ -292,7 +292,8 @@ export default function FormModal({
|
|||
ws.current.close();
|
||||
}
|
||||
};
|
||||
}, [connectWS]);
|
||||
// do not add connectWS on dependencies array
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
|
|
@ -303,7 +304,8 @@ export default function FormModal({
|
|||
connectWS();
|
||||
setLockChat(false);
|
||||
}
|
||||
}, [lockChat, connectWS]);
|
||||
// do not add connectWS on dependencies array
|
||||
}, [lockChat]);
|
||||
|
||||
async function sendAll(data: sendAllProps) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue