fix title filter not removing filter rule

This commit is contained in:
jonaswinkler
2020-12-14 11:12:36 +01:00
parent e1fef59e82
commit 98ab79ad5a
3 changed files with 29 additions and 18 deletions

View File

@@ -46,7 +46,9 @@ export class FilterEditorViewService {
set filterText(text: string) {
let filterRules = this.filterRules
let existingRule = filterRules.find(rule => rule.type.id == FILTER_TITLE)
if (existingRule && existingRule.value == text) {
if (existingRule && (!text || text.length == 0)) {
filterRules.splice(filterRules.findIndex(rule => rule.type.id == FILTER_TITLE), 1)
} else if (existingRule && existingRule.value == text) {
return
} else if (existingRule) {
existingRule.value = text