hotfix: fix bug that causes the blank screen
This commit is contained in:
parent
824ad20471
commit
b878e1af6a
1 changed files with 6 additions and 13 deletions
|
|
@ -215,19 +215,11 @@ export default function ChatModal({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ws.current = newWs;
|
ws.current = newWs;
|
||||||
} catch {
|
} catch (error) {
|
||||||
if (flow.id === "") {
|
if (flow.id === "") {
|
||||||
connectWS();
|
connectWS();
|
||||||
} else {
|
|
||||||
setErrorData({
|
|
||||||
title: "There was an error on web connection, please: ",
|
|
||||||
list: [
|
|
||||||
"Refresh the page",
|
|
||||||
"Use a new flow tab",
|
|
||||||
"Check if the backend is up",
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
console.log(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,7 +228,7 @@ export default function ChatModal({
|
||||||
return () => {
|
return () => {
|
||||||
console.log("unmount");
|
console.log("unmount");
|
||||||
console.log(ws);
|
console.log(ws);
|
||||||
if (ws) {
|
if (ws.current) {
|
||||||
ws.current.close();
|
ws.current.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -244,8 +236,9 @@ export default function ChatModal({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
ws.current.readyState === ws.current.CLOSED ||
|
ws.current &&
|
||||||
ws.current.readyState === ws.current.CLOSING
|
(ws.current.readyState === ws.current.CLOSED ||
|
||||||
|
ws.current.readyState === ws.current.CLOSING)
|
||||||
) {
|
) {
|
||||||
connectWS();
|
connectWS();
|
||||||
setLockChat(false);
|
setLockChat(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue