MCPcopy Create free account
hub / github.com/Roy3838/Observer / check

Function check

app/src/mcp/useRemoteControl.ts:85–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83 useEffect(() => {
84 let cancelled = false;
85 const check = async () => {
86 const code = SensorSettings.getWhitelistCode();
87 const token = code ? await getTokenRef.current().catch(() => undefined) : undefined;
88 if (!code || !token) {
89 if (!cancelled) setLinked(null);
90 return;
91 }
92 const status = await fetchStatus(code, token).catch(() => null);
93 if (!cancelled && status) setLinked(status.linked);
94 };
95 check();
96 const interval = window.setInterval(check, STATUS_POLL_MS);
97 return () => { cancelled = true; clearInterval(interval); };

Callers 1

useRemoteControlFunction · 0.70

Calls 2

fetchStatusFunction · 0.90
getWhitelistCodeMethod · 0.80

Tested by

no test coverage detected