Skip to content

Commit 0e2b7c8

Browse files
committed
fix: 修复上次 examples 错误
1 parent 99aae1c commit 0e2b7c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/src/components/AgentChatComponent.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ const currentAgentName = computed(() => {
247247
return '智能体';
248248
});
249249
250-
const currentAgent = computed(() => agents.value[currentAgentId.value] || null);
250+
const currentAgent = computed(() => {
251+
if (!currentAgentId.value || !agents.value || !agents.value.length) return null;
252+
return agents.value.find(a => a.id === currentAgentId.value) || null;
253+
});
251254
const chatsList = computed(() => threads.value || []);
252255
const currentChatId = computed(() => chatState.currentThreadId);
253256
const currentThread = computed(() => {

0 commit comments

Comments
 (0)