We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad91130 commit 6b79501Copy full SHA for 6b79501
1 file changed
frontend/src/hooks/useActiveSocketConnection.ts
@@ -19,9 +19,14 @@ export const useActiveSocketConnection = () => {
19
console.log("Socket connection failed", socketConnectionCount.current)
20
// If the socket connection fails more than 2 times, then show an error message
21
if (socketConnectionCount.current === 2) {
22
- toast.error("Realtime events are not working. Please try refreshing the page.", {
23
- duration: 5000
24
- })
+ const isToastActive = toast.getToasts().some(toast => toast.id === "socket-connection-error")
+ if (!isToastActive) {
+ toast.error("Realtime events are not working. Please try refreshing the page.", {
25
+ duration: 5000,
26
+ closeButton: true,
27
+ id: "socket-connection-error"
28
+ })
29
+ }
30
} else {
31
// Else try to connect to socket
32
socket?.connect()
0 commit comments