MCPcopy Create free account
hub / github.com/Noumena-Network/code / DevBar

Function DevBar

src/components/DevBar.tsx:12–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 return process.env.NODE_ENV === 'development' || isInternalBuild();
11}
12export function DevBar() {
13 const $ = _c(5);
14 const [slowOps, setSlowOps] = useState(getSlowOperations);
15 let t0;
16 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
17 t0 = () => {
18 setSlowOps(getSlowOperations());
19 };
20 $[0] = t0;
21 } else {
22 t0 = $[0];
23 }
24 useInterval(t0, shouldShowDevBar() ? 500 : null);
25 if (!shouldShowDevBar() || slowOps.length === 0) {
26 return null;
27 }
28 let t1;
29 if ($[1] !== slowOps) {
30 t1 = slowOps.slice(-3).map(_temp).join(" \xB7 ");
31 $[1] = slowOps;
32 $[2] = t1;
33 } else {
34 t1 = $[2];
35 }
36 const recentOps = t1;
37 let t2;
38 if ($[3] !== recentOps) {
39 t2 = <Text wrap="truncate-end" color="warning">[NOUMENA-ONLY] slow sync: {recentOps}</Text>;
40 $[3] = recentOps;
41 $[4] = t2;
42 } else {
43 t2 = $[4];
44 }
45 return t2;
46}
47function _temp(op) {
48 return `${op.operation} (${Math.round(op.durationMs)}ms)`;
49}

Callers

nothing calls this directly

Calls 3

getSlowOperationsFunction · 0.85
useIntervalFunction · 0.85
shouldShowDevBarFunction · 0.85

Tested by

no test coverage detected