MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / onPopState

Function onPopState

dashboard/shell/src/main.jsx:229–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

227 // disagreeing about the active tab.
228 useEffect(() => {
229 function onPopState() {
230 const name = tabFromUrl();
231 const list = pluginsRef.current;
232 const target = list.some((p) => p.name === name) ? name : list[0]?.name;
233 if (target) selectTab(target, { writeUrl: false });
234 }
235 window.addEventListener("popstate", onPopState);
236 return () => window.removeEventListener("popstate", onPopState);
237 }, [selectTab]);

Callers

nothing calls this directly

Calls 1

tabFromUrlFunction · 0.85

Tested by

no test coverage detected