Merge branch 'ItzCrazyKns:master' into master
This commit is contained in:
commit
f51541195e
11 changed files with 129 additions and 2421 deletions
|
|
@ -59,7 +59,9 @@ const useSocket = (
|
|||
chatModelProvider = Object.keys(chatModelProviders)[0];
|
||||
|
||||
if (chatModelProvider === 'custom_openai') {
|
||||
toast.error('Seems like you are using the custom OpenAI provider, please open the settings and configure the API key and base URL');
|
||||
toast.error(
|
||||
'Seems like you are using the custom OpenAI provider, please open the settings and configure the API key and base URL',
|
||||
);
|
||||
setError(true);
|
||||
return;
|
||||
} else {
|
||||
|
|
@ -192,20 +194,13 @@ const useSocket = (
|
|||
if (data.type === 'error') {
|
||||
toast.error(data.data);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
setWs(ws);
|
||||
};
|
||||
|
||||
connectWs();
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (ws?.readyState === 1) {
|
||||
ws?.close();
|
||||
console.log('[DEBUG] closed');
|
||||
}
|
||||
};
|
||||
}, [ws, url, setIsWSReady, setError]);
|
||||
|
||||
return ws;
|
||||
|
|
@ -311,6 +306,15 @@ const ChatWindow = ({ id }: { id?: string }) => {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (ws?.readyState === 1) {
|
||||
ws.close();
|
||||
console.log('[DEBUG] closed');
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const messagesRef = useRef<Message[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "perplexica-frontend",
|
||||
"version": "1.9.0-rc1",
|
||||
"version": "1.9.0-rc2",
|
||||
"license": "MIT",
|
||||
"author": "ItzCrazyKns",
|
||||
"scripts": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue