From f626a770e3b3621583b773702ab0bdb4b7d0a803 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Tue, 30 Jul 2024 12:34:03 +0200 Subject: [PATCH] test for not killing entire window when ws closes --- ui/components/ChatWindow.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/components/ChatWindow.tsx b/ui/components/ChatWindow.tsx index 74df3b2..01c10aa 100644 --- a/ui/components/ChatWindow.tsx +++ b/ui/components/ChatWindow.tsx @@ -26,7 +26,7 @@ const fetchSettings = async () => { try { const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/settings`); const settings = await res.json(); - + if (settings) { localStorage.setItem('chatModelProvider', settings.chatModelProvider); localStorage.setItem('chatModel', settings.chatModel); @@ -215,7 +215,8 @@ const useSocket = ( ws.onclose = () => { clearTimeout(timeoutId); - setError(true); + //setError(true); + setWs(null); console.log('[DEBUG] closed'); };