MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / request

Method request

ts/network_ts.ts:239–264  ·  view source on GitHub ↗
(data: Object)

Source from the content-addressed store, hash-verified

237 }
238
239 request(data: Object): any {
240 if (SERVER_CONNECTION == true) {
241 return;
242 }
243
244 SERVER_CONNECTION = true;
245
246 console.log(data);
247 if (this.cmd != "updateLog") {
248 UNDO = new Object();
249 }
250
251 // Prepare the request data
252 data["cmd"] = this.cmd;
253 const requestData = JSON.stringify(data);
254
255 // Use existing WebSocket connection
256 if (globalWS && globalWS.readyState === WebSocket.OPEN) {
257 globalWS.send(requestData);
258 } else {
259 // Initialize connection if not available
260 initWebSocket();
261 // Add to pending requests queue
262 pendingRequests.push({cmd: this.cmd, data: data});
263 }
264 }
265}
266
267// Initialize WebSocket connection when the page loads

Callers 10

resetLogsFunction · 0.95
saveSettingsFunction · 0.95
backupFunction · 0.95
restoreFunction · 0.95
uploadLogoFunction · 0.95
probeChannelFunction · 0.95
readyForConfigurationFunction · 0.95
saveWizardFunction · 0.95
PageReadyFunction · 0.95
savePopupDataFunction · 0.95

Calls 1

initWebSocketFunction · 0.70

Tested by

no test coverage detected