feat(chat-window): display toast when retried
This commit is contained in:
parent
b7f7d25f54
commit
99cae076a7
1 changed files with 4 additions and 1 deletions
|
@ -237,8 +237,11 @@ const useSocket = (
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
if (ws.readyState === 1) {
|
if (ws.readyState === 1) {
|
||||||
setIsWSReady(true);
|
setIsWSReady(true);
|
||||||
retryCountRef.current = 0;
|
|
||||||
setError(false);
|
setError(false);
|
||||||
|
if (retryCountRef.current > 0) {
|
||||||
|
toast.success('Connection restored.');
|
||||||
|
}
|
||||||
|
retryCountRef.current = 0;
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
}
|
}
|
||||||
}, 5);
|
}, 5);
|
||||||
|
|
Loading…
Add table
Reference in a new issue