Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Fix trades window-segment toggle (NodeList has no forEach via $)

nirholase56d806d7b2e
diff --git a/src/trades.js b/src/trades.js
index a7a8f78f2..36abef1c1 100644
--- a/src/trades.js
+++ b/src/trades.js
@@ -29,6 +29,7 @@ const API = '/api/trades/feed';
const REFRESH_MS = 30_000;
const $ = (sel, root = document) => root.querySelector(sel);
+const $$ = (sel, root = document) => [...root.querySelectorAll(sel)];
const state = {
window: '24h',
@@ -48,7 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
$('#tfWinSeg').addEventListener('click', (e) => {
const b = e.target.closest('[data-win]');
if (!b) return;
- $('#tfWinSeg button').forEach((x) => x.classList.toggle('on', x === b));
+ $$('#tfWinSeg button').forEach((x) => x.classList.toggle('on', x === b));
state.window = b.dataset.win;
state.cursor = null;
writeUrl();
@@ -135,7 +136,7 @@ function applyStateToControls() {
$('#tfMinPnl').value = String(state.minPnl);
$('#tfNetwork').value = state.network;
// sync seg buttons
- $('#tfWinSeg button').forEach((b) => b.classList.toggle('on', b.dataset.win === state.window));
+ $$('#tfWinSeg button').forEach((b) => b.classList.toggle('on', b.dataset.win === state.window));
}
// ── Fetch + render ────────────────────────────────────────────────────────────