mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
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:
@@ -13,7 +13,7 @@ interface SessionListProps {
|
||||
}
|
||||
|
||||
export function SessionList({
|
||||
selectedSessionId,
|
||||
selectedSessionId = '',
|
||||
onSelectSession,
|
||||
}: SessionListProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user