MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / onRefreshPositions

Function onRefreshPositions

src/components/WalletButton.tsx:395–398  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

393 const iv = setInterval(fetchPositions, 30_000);
394 let posTimer: ReturnType<typeof setTimeout> | null = null;
395 const onRefreshPositions = () => {
396 if (posTimer) clearTimeout(posTimer);
397 posTimer = setTimeout(() => { void fetchPositions(); }, 200);
398 };
399 window.addEventListener("polyworld:refresh-header-balance", onRefreshPositions);
400 return () => { cancelled = true; clearInterval(iv); if (posTimer) clearTimeout(posTimer); window.removeEventListener("polyworld:refresh-header-balance", onRefreshPositions); };
401 }, [effectiveProxy]);

Callers

nothing calls this directly

Calls 1

fetchPositionsFunction · 0.85

Tested by

no test coverage detected