fix: 历史对话列表不显示空对话
- 新建对话但没有发送消息时,不显示在历史列表中 - normalConversations过滤条件增加 messages.length > 0 - 同时过滤搜索结果的空对话
This commit is contained in:
@@ -521,8 +521,8 @@ function bindPageEvents() {
|
||||
// ==================== 对话页面 ====================
|
||||
|
||||
function renderChatsPage() {
|
||||
// 只显示没有智能体的普通对话
|
||||
const normalConversations = conversations.filter(conv => !conv.agentId);
|
||||
// 只显示没有智能体的普通对话,且必须有消息内容(空对话不显示)
|
||||
const normalConversations = conversations.filter(conv => !conv.agentId && conv.messages && conv.messages.length > 0);
|
||||
|
||||
return `
|
||||
<div class="chats-page">
|
||||
@@ -3194,8 +3194,8 @@ function searchConversations(keyword) {
|
||||
|
||||
keyword = keyword.toLowerCase();
|
||||
|
||||
// 只搜索没有智能体的普通对话
|
||||
const normalConversations = conversations.filter(conv => !conv.agentId);
|
||||
// 只搜索没有智能体的普通对话,且必须有消息内容
|
||||
const normalConversations = conversations.filter(conv => !conv.agentId && conv.messages && conv.messages.length > 0);
|
||||
|
||||
// 搜索标题和消息内容
|
||||
const results = normalConversations.filter(conv => {
|
||||
|
||||
Reference in New Issue
Block a user