Skip to content

Commit 6712b50

Browse files
authored
Fix: Clicking on the empty dialog box on the agent exploration page will result in an error. (infiniflow#14198)
### What problem does this PR solve? Fix: Clicking on the empty dialog box on the agent exploration page will result in an error. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent c3387cd commit 6712b50

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

web/src/pages/agent/explore/components/session-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface SessionListProps {
1313
}
1414

1515
export function SessionList({
16-
selectedSessionId,
16+
selectedSessionId = '',
1717
onSelectSession,
1818
}: SessionListProps) {
1919
const { t } = useTranslation();

web/src/pages/agent/explore/hooks/use-select-derived-session-list.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useFetchSessionsByCanvasId } from '@/hooks/use-agent-request';
22
import { IAgentLogResponse } from '@/interfaces/database/agent';
3-
import { generateConversationId } from '@/utils/chat';
43
import { useCallback, useEffect, useState } from 'react';
54
import { useExploreUrlParams } from './use-explore-url-params';
65

@@ -14,11 +13,10 @@ export const useSelectDerivedSessionList = () => {
1413
const { setSessionId } = useExploreUrlParams();
1514

1615
const addTemporarySession = useCallback(() => {
17-
const sessionId = generateConversationId();
1816
const now = Date.now() / 1000;
1917

2018
const tempSession: IAgentLogResponse & { is_new?: boolean } = {
21-
id: sessionId,
19+
id: '',
2220
message: [],
2321
create_date: '',
2422
create_time: now,

0 commit comments

Comments
 (0)