added error handling

This commit is contained in:
anovazzi1 2023-05-10 20:30:14 -03:00
commit 32972b0f8a

View file

@ -90,7 +90,7 @@ export default function ChatModal({
function handleOnClose(event: CloseEvent) { function handleOnClose(event: CloseEvent) {
if (isOpen.current) { if (isOpen.current) {
console.log(event); setErrorData({ title: event.reason });
setLockChat(false); setLockChat(false);
setTimeout(() => { setTimeout(() => {
connectWS(); connectWS();
@ -133,7 +133,6 @@ export default function ChatModal({
}); });
} }
if (data.type === "start") { if (data.type === "start") {
console.log("start");
addChatHistory("", false); addChatHistory("", false);
isStream = true; isStream = true;
} }