fix tegumentar janela

This commit is contained in:
Rodrigo Bertoldo de Sousa Martins committed 2026-09-11 13:10:08 -03:00
1 parent c8fba4d240
commit ce851b9cf9
1 file changed
+7 -2
+7 -2
View File
@@ -38,9 +38,14 @@ export function useSystemStructures(visibleSystems: Set<string>) {
};
}, [visibleSystems]);
// Importante: filtrar pelos sistemas ATUALMENTE visíveis, não devolver
// tudo que já foi buscado alguma vez. O cache em si guarda tudo (evita
// recarregar ao reativar um sistema), mas sem esse filtro um sistema
// desligado (ex: fechar o diagrama do tegumentar) continuava aparecendo
// no `bySlug` pra sempre, porque nada nunca removia a entrada do cache.
const structures = useMemo(
() => [...cacheRef.current.values()].flat(),
// eslint-disable-next-line react-hooks/exhaustive-deps
() =>
[...visibleSystems].flatMap((slug) => cacheRef.current.get(slug) ?? []),
[version, visibleSystems],
);