Remove sections with no lists in "Filter lists" pane

Related feedback:
https://github.com/uBlockOrigin/uBlock-issues/issues/3154#issuecomment-1975413427
This commit is contained in:
Raymond Hill 2024-03-03 20:05:45 -05:00
parent ca432fa5d2
commit 0f4e50db07
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 8 additions and 0 deletions

View File

@ -254,6 +254,14 @@ const renderFilterLists = ( ) => {
groupDetails.lists[listkey] = listDetails; groupDetails.lists[listkey] = listDetails;
} }
} }
// https://github.com/uBlockOrigin/uBlock-issues/issues/3154#issuecomment-1975413427
// Remove empty sections
for ( const groupkey of groupKeys ) {
const lists = listTree[groupkey].lists;
if ( Object.keys(lists).length !== 0 ) { continue; }
delete listTree[groupkey];
}
const listEntries = createListEntries('root', listTree); const listEntries = createListEntries('root', listTree);
qs$('#lists .listEntries').replaceWith(listEntries); qs$('#lists .listEntries').replaceWith(listEntries);