Skip to content

Commit e2befa9

Browse files
committed
Set ping stop to 3x failed pings
1 parent fd174ab commit e2befa9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peerprep/components/questionpage/CollabEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export default function CollabEditor({
265265
const disconnectCheckInterval = setInterval(() => {
266266
if (
267267
lastPingReceived &&
268-
Date.now() - lastPingReceived > 5 * PING_INTERVAL_MILLISECONDS
268+
Date.now() - lastPingReceived > 3 * PING_INTERVAL_MILLISECONDS
269269
) {
270270
setOtherUserConnected(false);
271271
clearInterval(disconnectCheckInterval);
@@ -276,7 +276,7 @@ export default function CollabEditor({
276276
clearInterval(interval);
277277
clearInterval(disconnectCheckInterval);
278278
};
279-
}, [notifyRoomOfConnection, PING_INTERVAL_MILLISECONDS, connected, socket]);
279+
}, [notifyRoomOfConnection, connected, socket]);
280280

281281
const handleCloseConnection = () => {
282282
const confirmClose = confirm(

0 commit comments

Comments
 (0)