test for not killing entire window when ws closes
This commit is contained in:
parent
a9f960a652
commit
f8f1b31cb3
|
@ -26,7 +26,7 @@ const fetchSettings = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/settings`);
|
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/settings`);
|
||||||
const settings = await res.json();
|
const settings = await res.json();
|
||||||
|
|
||||||
if (settings) {
|
if (settings) {
|
||||||
localStorage.setItem('chatModelProvider', settings.chatModelProvider);
|
localStorage.setItem('chatModelProvider', settings.chatModelProvider);
|
||||||
localStorage.setItem('chatModel', settings.chatModel);
|
localStorage.setItem('chatModel', settings.chatModel);
|
||||||
|
@ -215,7 +215,7 @@ const useSocket = (
|
||||||
|
|
||||||
ws.onclose = () => {
|
ws.onclose = () => {
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
setError(true);
|
setWs(null); // forces websocket to reopen when needed.
|
||||||
console.log('[DEBUG] closed');
|
console.log('[DEBUG] closed');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue