This commit is contained in:
2020-10-07 18:04:48 +00:00
parent 077a75589a
commit f753f586b7
3 changed files with 26 additions and 6 deletions

View File

@@ -655,8 +655,19 @@ export default {
filterItem.value,
item.enumType
);
//add only if not already in the collection (accidental double click)
if (!window.$gz._.find(item.filter.items, filterItem)) {
//de-lodash
// if (!window.$gz._.find(item.filter.items, filterItem)) {
//some fits better here as it only test for truthiness and returns immediately on true
//also the item is unique and display doesn't need to be compared for equality it's irrelevant
//so only the op and the value need to be checked
if (
!item.filter.items.some(
z => z.op == filterItem.op && z.value == filterItem.value
)
) {
item.filter.items.push(filterItem);
window.$gz.form.setFormState({
vm: this,