Fix looking-up unexisting sections in "Filter lists" pane

Related feedback:
https://old.reddit.com/r/uBlockOrigin/comments/1b6tad0/i_updated_to_the_new_dev_build_1561b10_and_now/
This commit is contained in:
Raymond Hill 2024-03-04 23:57:47 -05:00
parent 3682eed638
commit 238724eed1
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 8 additions and 5 deletions

View File

@ -238,8 +238,9 @@ const renderFilterLists = ( ) => {
};
}
for ( const [ listkey, listDetails ] of Object.entries(response.available) ) {
let groupKey = listDetails.group;
const groupDetails = listTree[groupKey];
const groupkey = listDetails.group;
const groupDetails = listTree[groupkey];
if ( groupDetails === undefined ) { continue; }
if ( listDetails.parent !== undefined ) {
let lists = groupDetails.lists;
for ( const parent of listDetails.parent.split('|') ) {
@ -257,8 +258,9 @@ const renderFilterLists = ( ) => {
// 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; }
const groupDetails = listTree[groupkey];
if ( groupDetails === undefined ) { continue; }
if ( Object.keys(groupDetails.lists).length !== 0 ) { continue; }
delete listTree[groupkey];
}
@ -707,7 +709,8 @@ dom.on('.searchbar input', 'input', searchFilterLists);
/******************************************************************************/
const expandedListSet = new Set([
'uBlock filters',
'cookies',
'social',
]);
const listIsExpanded = which => {