From 64486f40f6293c4250b464b89ac3c8d9d192f37e Mon Sep 17 00:00:00 2001 From: enlineawork Date: Thu, 10 Sep 2026 20:16:59 -0300 Subject: [PATCH] ux: stop persisting hidden operational filters --- web-v2/src/context/OperationalContext.tsx | 27 ++++++----------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/web-v2/src/context/OperationalContext.tsx b/web-v2/src/context/OperationalContext.tsx index bb515f1..f7692e9 100644 --- a/web-v2/src/context/OperationalContext.tsx +++ b/web-v2/src/context/OperationalContext.tsx @@ -10,31 +10,18 @@ interface OperationalContextValue { clearContext: () => void; } -const STORAGE_KEY = 'dhv2.operational-context'; +const LEGACY_STORAGE_KEY = 'dhv2.operational-context'; const OperationalContext = createContext(null); -function readStoredContext(): { areaId: string; companyId: string } { - try { - const raw = window.localStorage.getItem(STORAGE_KEY); - if (!raw) return { areaId: '', companyId: '' }; - const parsed = JSON.parse(raw) as { areaId?: unknown; companyId?: unknown }; - return { - areaId: typeof parsed.areaId === 'string' ? parsed.areaId : '', - companyId: typeof parsed.companyId === 'string' ? parsed.companyId : '', - }; - } catch { - return { areaId: '', companyId: '' }; - } -} - export function OperationalContextProvider({ children }: PropsWithChildren) { - const initial = useMemo(readStoredContext, []); - const [areaId, setAreaState] = useState(initial.areaId); - const [companyId, setCompanyState] = useState(initial.companyId); + const [areaId, setAreaState] = useState(''); + const [companyId, setCompanyState] = useState(''); useEffect(() => { - window.localStorage.setItem(STORAGE_KEY, JSON.stringify({ areaId, companyId })); - }, [areaId, companyId]); + // F6.2 retiró la barra global Área/Operadora. Un contexto persistido sin + // controles visibles podía seguir filtrando pantallas de forma inesperada. + window.localStorage.removeItem(LEGACY_STORAGE_KEY); + }, []); const value = useMemo(() => ({ areaId,