1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00

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

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 => {