1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00

Ensure saved items that are marked for removal don't impact the index

This commit is contained in:
hatz 2025-05-11 12:13:28 -05:00
parent 555ab8fb97
commit df096c9b5f
No known key found for this signature in database

View file

@ -72,6 +72,9 @@ export default class extends Controller {
const items = Array.from(listEl.children);
let conditionIdx = 0;
items.forEach((item) => {
// Only process visible items, this prevents conditions that are marked for removal and hidden
// from being added to the index. This is important when editing a rule.
if (!item.classList.contains('hidden')) {
const prefixEl = item.querySelector('[data-condition-prefix]');
if (prefixEl) {
if (conditionIdx === 0) {
@ -81,6 +84,7 @@ export default class extends Controller {
}
conditionIdx++;
}
}
});
}
}