Last time fixing the toggling logic, I hope =/

This commit is contained in:
Michael Shamoon 2020-12-13 11:33:57 -08:00
parent 3d8cd0f0d6
commit 7d212f6e80

View File

@ -108,9 +108,9 @@ export class FilterEditorViewService {
if (existingRules && existingItemRule) {
filterRules.splice(filterRules.indexOf(existingItemRule), 1) // if exact rule exists just remove
} else if (existingItemRule && filterRuleType.multi) { // e.g. tags can have multiple
} else if (existingRules.length > 0 && filterRuleType.multi) { // e.g. tags can have multiple
filterRules.push({type: filterRuleType, value: item.id})
} else if (existingRules.length) { // Correspondents & DocumentTypes only one
} else if (existingRules.length > 0) { // Correspondents & DocumentTypes only one
filterRules.find(rule => rule.type.id == filterRuleType.id).value = item.id
} else {
filterRules.push({type: filterRuleType, value: item.id})