[editor] Fix: Allow empty description in sorting / filter

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-04-25 22:47:55 +02:00
parent 86144f8783
commit 967e301390
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -615,8 +615,8 @@ export default {
filteredRules() {
const rules = [...this.rules]
.filter(rule => !this.filter || rule.description.toLocaleLowerCase().includes(this.filter.toLocaleLowerCase()))
rules.sort((a, b) => a.description.toLocaleLowerCase().localeCompare(b.description.toLocaleLowerCase()))
.filter(rule => !this.filter || rule.description?.toLocaleLowerCase().includes(this.filter?.toLocaleLowerCase()))
rules.sort((a, b) => a.description?.toLocaleLowerCase().localeCompare(b.description?.toLocaleLowerCase()))
return rules
},
},