Do not add empty separator in URLMenuFilter
This commit is contained in:
parent
46c4e66558
commit
e8f09c80f3
@ -343,12 +343,16 @@ export class UrlMenuFilter extends MenuFilter {
|
|||||||
this.addItem(
|
this.addItem(
|
||||||
i.label, this.toggleRegularFilter.bind(this, i), this.filters.has(i));
|
i.label, this.toggleRegularFilter.bind(this, i), this.filters.has(i));
|
||||||
}
|
}
|
||||||
this.addItem("-");
|
const domains = sort(
|
||||||
sort(
|
|
||||||
Array.from(new Set(this.collection.items.map(e => e.domain))),
|
Array.from(new Set(this.collection.items.map(e => e.domain))),
|
||||||
undefined,
|
undefined,
|
||||||
naturalCaseCompare
|
naturalCaseCompare
|
||||||
).forEach(e => {
|
);
|
||||||
|
if (!domains.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.addItem("-");
|
||||||
|
domains.forEach(e => {
|
||||||
this.addItem(
|
this.addItem(
|
||||||
e, this.toggleDomainFilter.bind(this, e), this.domains.has(e));
|
e, this.toggleDomainFilter.bind(this, e), this.domains.has(e));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user