Skip to content

Commit

Permalink
fix: Correct color propagation in node animation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 6, 2024
1 parent 63936f2 commit 867f24c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions hugo-site/layouts/shortcodes/summary-delta-sync/propagation.html
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,15 @@
.remove()
.end();

// Add colors to target after animation completes
let colorsAdded = false;
validColors.forEach(color => {
if (!target.data.receivedColors.includes(color)) {
target.data.receivedColors.push(color);
colorsAdded = true;
// Add new colors to target after animation completes
colors.forEach(colorEntry => {
if (!target.data.receivedColors.some(existing => existing.seq === colorEntry.seq)) {
target.data.receivedColors.push(colorEntry);
}
});

if (colorsAdded) {
updateNodeColors(target);
}
// Update the node's visual appearance
updateNodeColors(target);
} finally {
// Clear animation flag when done
animationQueue.delete(animationKey);
Expand Down

0 comments on commit 867f24c

Please sign in to comment.