mirror of
https://github.com/gorhill/uBlock.git
synced 2024-08-31 08:09:38 +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:
parent
3682eed638
commit
238724eed1
@ -238,8 +238,9 @@ const renderFilterLists = ( ) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for ( const [ listkey, listDetails ] of Object.entries(response.available) ) {
|
for ( const [ listkey, listDetails ] of Object.entries(response.available) ) {
|
||||||
let groupKey = listDetails.group;
|
const groupkey = listDetails.group;
|
||||||
const groupDetails = listTree[groupKey];
|
const groupDetails = listTree[groupkey];
|
||||||
|
if ( groupDetails === undefined ) { continue; }
|
||||||
if ( listDetails.parent !== undefined ) {
|
if ( listDetails.parent !== undefined ) {
|
||||||
let lists = groupDetails.lists;
|
let lists = groupDetails.lists;
|
||||||
for ( const parent of listDetails.parent.split('|') ) {
|
for ( const parent of listDetails.parent.split('|') ) {
|
||||||
@ -257,8 +258,9 @@ const renderFilterLists = ( ) => {
|
|||||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/3154#issuecomment-1975413427
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/3154#issuecomment-1975413427
|
||||||
// Remove empty sections
|
// Remove empty sections
|
||||||
for ( const groupkey of groupKeys ) {
|
for ( const groupkey of groupKeys ) {
|
||||||
const lists = listTree[groupkey].lists;
|
const groupDetails = listTree[groupkey];
|
||||||
if ( Object.keys(lists).length !== 0 ) { continue; }
|
if ( groupDetails === undefined ) { continue; }
|
||||||
|
if ( Object.keys(groupDetails.lists).length !== 0 ) { continue; }
|
||||||
delete listTree[groupkey];
|
delete listTree[groupkey];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -707,7 +709,8 @@ dom.on('.searchbar input', 'input', searchFilterLists);
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
const expandedListSet = new Set([
|
const expandedListSet = new Set([
|
||||||
'uBlock filters',
|
'cookies',
|
||||||
|
'social',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const listIsExpanded = which => {
|
const listIsExpanded = which => {
|
||||||
|
Loading…
Reference in New Issue
Block a user