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; isDirty = false;
nextTick(() => { nextTick(() => {
boundingRect.value = resizeListener.value?.getBoundingClientRect(); boundingRect.value = resizeListener.value?.getBoundingClientRect();
(Object.values(nodes.value) as FeatureNode[]).forEach( (Object.values(nodes.value) as FeatureNode[])
node => (node.rect = node.element.getBoundingClientRect()) .filter(n => n) // Sometimes the values become undefined
); .forEach(node => (node.rect = node.element.getBoundingClientRect()));
isDirty = true; isDirty = true;
}); });
} }