review error in toast
This commit is contained in:
parent
89713b2268
commit
f819e5f3eb
1 changed files with 5 additions and 13 deletions
|
@ -195,16 +195,11 @@ const useSocket = (
|
||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ws.addEventListener('message', (e) => {
|
ws.addEventListener('message', (e) => {
|
||||||
// const data = JSON.parse(e.data);
|
const data = JSON.parse(e.data);
|
||||||
// console.log(data);
|
if (data.type === 'error') {
|
||||||
|
}
|
||||||
// if (data.type === 'error') {
|
});
|
||||||
// console.log(data.data);
|
|
||||||
|
|
||||||
// toast.error(data.data);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
setWs(ws);
|
setWs(ws);
|
||||||
};
|
};
|
||||||
|
@ -379,9 +374,6 @@ const ChatWindow = ({ id }: { id?: string }) => {
|
||||||
const data = JSON.parse(e.data);
|
const data = JSON.parse(e.data);
|
||||||
|
|
||||||
if (data.type === 'error') {
|
if (data.type === 'error') {
|
||||||
toast.error(data.data);
|
|
||||||
console.log(data.data);
|
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue