mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-03 02:23:51 +00:00
fix: return no chats when a folder search term matches no folder (#30273)
This commit is contained in:
parent
f2220d2e40
commit
402a187e82
1 changed files with 3 additions and 5 deletions
|
|
@ -1988,10 +1988,8 @@ class ChatTable:
|
|||
]
|
||||
|
||||
# Extract folder names
|
||||
folders = await Folders.search_folders_by_names(
|
||||
user_id,
|
||||
[word.replace('folder:', '') for word in search_text_words if word.startswith('folder:')],
|
||||
)
|
||||
folder_names = [word.replace('folder:', '') for word in search_text_words if word.startswith('folder:')]
|
||||
folders = await Folders.search_folders_by_names(user_id, folder_names)
|
||||
folder_ids = [folder.id for folder in folders]
|
||||
|
||||
is_pinned = None
|
||||
|
|
@ -2035,7 +2033,7 @@ class ChatTable:
|
|||
else:
|
||||
stmt = stmt.filter(Chat.share_id.is_(None))
|
||||
|
||||
if folder_ids:
|
||||
if folder_names:
|
||||
stmt = stmt.filter(Chat.folder_id.in_(folder_ids))
|
||||
|
||||
# Check if the database dialect is either 'sqlite' or 'postgresql'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue