Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/swarm-ui/src/shell/useHideDebug.ts
iris 70917b7dd0 swarm-ui: hives are a folded card on the agents page, and hide developer details also hides the components tab
The hives nav tab and route go, with no redirect; the roster is a card above
the agents panel that starts folded and is read on the first open. The
settings toggle is renamed from hide debug output to hide developer details,
as it now also drops the components tab (the page still answers at
/components); the stored preference keeps its key.
2026-10-26 17:56:10 +01:00

17 lines
568 B
TypeScript

// The "hide developer details" preference as a value that follows its toggle:
// this tab's, through `setHideDebugPref`, and another tab's, through the
// `storage` event. The header uses it to hide the components tab.
import { useEffect, useState } from "preact/hooks";
import {
getHideDebugPref,
subscribeHideDebugPref,
} from "@hive/shared/prefs.js";
export function useHideDebug(): boolean {
const [hide, setHide] = useState(getHideDebugPref);
useEffect(
() => subscribeHideDebugPref(() => setHide(getHideDebugPref())),
[],
);
return hide;
}