MCPcopy Create free account
hub / github.com/The-Pocket/PocketFlow-Tutorial-Website-Chatbot / waitForConnection

Function waitForConnection

static/chatbot.js:1290–1297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1288
1289 // Wait for connection and send
1290 const waitForConnection = () => {
1291 if (socket?.readyState === WebSocket.OPEN) {
1292 socket.send(JSON.stringify(messageData));
1293 if (isFirstMessage) isFirstMessage = false;
1294 } else {
1295 setTimeout(waitForConnection, 5);
1296 }
1297 };
1298 waitForConnection();
1299 }
1300

Callers 1

sendMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected