Fix links sometimes using nodes that were removed

This commit is contained in:
thepaperpilot 2022-05-02 21:01:20 -05:00
parent 4058fad711
commit 2c14b2193d

View file

@ -43,9 +43,9 @@ function updateNodes() {
isDirty = false;
nextTick(() => {
boundingRect.value = resizeListener.value?.getBoundingClientRect();
(Object.values(nodes.value) as FeatureNode[]).forEach(
node => (node.rect = node.element.getBoundingClientRect())
);
(Object.values(nodes.value) as FeatureNode[])
.filter(n => n) // Sometimes the values become undefined
.forEach(node => (node.rect = node.element.getBoundingClientRect()));
isDirty = true;
});
}