mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
19 lines
707 B
TypeScript
19 lines
707 B
TypeScript
/**
|
||
* useDeveloperMode — runtime developer-mode gate.
|
||
*
|
||
* Returns `true` when developer surfaces should be visible. The gate is open
|
||
* when EITHER the build is a Vite dev build (`IS_DEV`) OR the user has
|
||
* enabled Developer Mode in Settings › About.
|
||
*
|
||
* Gating is UI-only. The Rust `SecurityPolicy` / autonomy-tier enforcement
|
||
* in the core is authoritative and is never relaxed by this toggle.
|
||
*/
|
||
import { useAppSelector } from '../store/hooks';
|
||
import { selectDeveloperMode } from '../store/themeSlice';
|
||
import { IS_DEV } from '../utils/config';
|
||
|
||
export function useDeveloperMode(): boolean {
|
||
const persistedMode = useAppSelector(selectDeveloperMode);
|
||
return IS_DEV || persistedMode;
|
||
}
|