Fix: Clicking on the empty dialog box on the agent exploration page will result in an error. (#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)
This commit is contained in:
balibabu
2026-04-17 23:52:13 +08:00
committed by GitHub
parent c3387cd5b8
commit 6712b504e6
2 changed files with 2 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ interface SessionListProps {
}
export function SessionList({
selectedSessionId,
selectedSessionId = '',
onSelectSession,
}: SessionListProps) {
const { t } = useTranslation();

View File

@@ -1,6 +1,5 @@
import { useFetchSessionsByCanvasId } from '@/hooks/use-agent-request';
import { IAgentLogResponse } from '@/interfaces/database/agent';
import { generateConversationId } from '@/utils/chat';
import { useCallback, useEffect, useState } from 'react';
import { useExploreUrlParams } from './use-explore-url-params';
@@ -14,11 +13,10 @@ export const useSelectDerivedSessionList = () => {
const { setSessionId } = useExploreUrlParams();
const addTemporarySession = useCallback(() => {
const sessionId = generateConversationId();
const now = Date.now() / 1000;
const tempSession: IAgentLogResponse & { is_new?: boolean } = {
id: sessionId,
id: '',
message: [],
create_date: '',
create_time: now,