feat(chat-window): clear storage after error

This commit is contained in:
ItzCrazyKns 2024-05-05 16:29:40 +05:30
parent 6e61c88c9e
commit 94ea6c372a
No known key found for this signature in database
GPG Key ID: 8162927C7CCE3065
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ const useSocket = (url: string) => {
const parsedData = JSON.parse(e.data); const parsedData = JSON.parse(e.data);
if (parsedData.type === 'error') { if (parsedData.type === 'error') {
toast.error(parsedData.data); toast.error(parsedData.data);
if (parsedData.key === 'INVALID_MODEL_SELECTED') {
localStorage.clear();
}
} }
}; };
}; };