fix bug in last PR that broke switching libraries

This commit is contained in:
Kovid Goyal 2023-02-27 08:45:51 +05:30
parent 312f5bd1e7
commit ebda3cdfa6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -450,11 +450,11 @@ class SavedSearchBoxMixin: # {{{
use_hierarchy = 'search' in db.new_api.pref('categories_using_hierarchy', [])
submenus = {}
for name in sorted(db.saved_search_names(), key=lambda x: primary_sort_key(x.strip())):
current_menu = menu
if use_hierarchy:
components = tuple(n.strip() for n in name.split('.'))
hierarchy = components[:-1]
last = components[-1]
current_menu = menu
# Walk the hierarchy, creating submenus as needed
for i,c in enumerate(hierarchy, start=1):
hierarchical_prefix = '.'.join(hierarchy[:i])