Skip to content
Merged
Prev Previous commit
Next Next commit
Fix bad loop conversion
  • Loading branch information
camdecoster committed Oct 14, 2025
commit 1b659381316d1d1910124f0f1d110fce16b8e6eb
12 changes: 9 additions & 3 deletions src/plot_api/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,16 +523,22 @@ const hasCollectionChanged = (oldCollection, newCollection) => {
for (let i = 0; i < oldCollection.length; i++) {
const oldVal = oldCollection[i];
const newVal = newCollection[i];
if (oldVal !== newVal) return isArrayOrObject(oldVal, newVal) ? hasCollectionChanged(oldVal, newVal) : true;
if (oldVal !== newVal) {
const hasChanged = isArrayOrObject(oldVal, newVal) ? hasCollectionChanged(oldVal, newVal) : true;
if (hasChanged) return true;
}
}
} else {
if (Object.keys(oldCollection).length !== Object.keys(newCollection).length) return true;

for (const k in oldCollection) {
if (k.startsWith('_')) return false;
if (k.startsWith('_')) continue;
const oldVal = oldCollection[k];
const newVal = newCollection[k];
if (oldVal !== newVal) return isArrayOrObject(oldVal, newVal) ? hasCollectionChanged(oldVal, newVal) : true;
if (oldVal !== newVal) {
const hasChanged = isArrayOrObject(oldVal, newVal) ? hasCollectionChanged(oldVal, newVal) : true;
if (hasChanged) return true;
}
}
}

Expand Down