fix hide wrong collapsed nodes

This commit is contained in:
victorbrambati 2022-08-29 17:26:59 -03:00
parent c7475bb955
commit bb8731e7ec

View File

@ -133,8 +133,8 @@ export const Graph = ({ isWidget = false }: { isWidget?: boolean }) => {
const collapsedEdges = useGraph((state) => state.collapsedEdges);
React.useEffect(() => {
const nodeList = collapsedNodes.map((id) => `[id*="node-${id}"]`);
const edgeList = collapsedEdges.map((id) => `[class*="edge-${id}"]`);
const nodeList = collapsedNodes.map((id) => `[id$="node-${id}"]`);
const edgeList = collapsedEdges.map((id) => `[class$="edge-${id}"]`);
const hiddenItems = document.querySelectorAll(".hide");
hiddenItems.forEach((item) => item.classList.remove("hide"));