Move god mode state to global useUserInfo hook

Fixkamo-internal
Shipped
24 Oktoba 2025, 21:44 UTC
Author
snadjafinia
Commit
da97785

BREAKING FIX: Properly separates isGod and isGodMode Architecture (as intended): - isGod: Permission from session (GD field) - Can user access god mode? - isGodMode: Global UI state - Is god mode currently ON/OFF? - isGodModeActive(): Returns (isGod AND isGodMode) - Secure check Changes to useUserInfo hook: - Add isGodMode state (global, not local to NavTop) - Add setIsGodMode() to control god mode state globally - isGodModeActive() now checks: isGod (session) AND isGodMode (state) - Auto-loads/saves to localStorage Changes to NavTop: - Remove local godModeActive state - Use global isGodMode from hook - Use setIsGodMode to toggle - Display based on isGodMode state This fixes: - God mode state now accessible from any component - Properly isolated from accepting leads toggle - Secure validation: even if isGodMode=true, returns false if isGod=false Other components can now use: - getIsGod() - Check if user has permission - isGodModeActive() - Check if god mode is permitted AND enabled

All changes

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei