Skip to content

Commit

Permalink
add alert on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilaboz committed Nov 21, 2023
1 parent bad21fa commit 7295d63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions front/src/components/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ const Chat = () => {
setCurrentChannel(data);
setJoinedChannels((prev) => [...prev, data]);
});

tmpSocket.on('exception', (data) => {
if (Array.isArray(data.message)) {
alert(data.message.join('\n'));
} else {
alert(data.message);
}
});
});

return () => {
Expand Down

0 comments on commit 7295d63

Please sign in to comment.