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();
|
ws.current.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [connectWS]);
|
// do not add connectWS on dependencies array
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
|
|
@ -303,7 +304,8 @@ export default function FormModal({
|
||||||
connectWS();
|
connectWS();
|
||||||
setLockChat(false);
|
setLockChat(false);
|
||||||
}
|
}
|
||||||
}, [lockChat, connectWS]);
|
// do not add connectWS on dependencies array
|
||||||
|
}, [lockChat]);
|
||||||
|
|
||||||
async function sendAll(data: sendAllProps) {
|
async function sendAll(data: sendAllProps) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue