diff --git a/client/app/factory/edit/[id]/page.tsx b/client/app/factory/edit/[id]/page.tsx index a59d2a74..4a63efb6 100644 --- a/client/app/factory/edit/[id]/page.tsx +++ b/client/app/factory/edit/[id]/page.tsx @@ -106,6 +106,16 @@ export default function Edit({ params }: { params: { id: string } }) { [params?.id, botProfile?.id], ); + const botId = useMemo(() => { + if (!!params?.id && params?.id !== 'new') { + return params.id; + } else if (!!botProfile?.id) { + return botProfile.id; + } else { + return undefined; + } + }, [params?.id, botProfile?.id]); + const { data: config, isLoading } = useBotConfig( params?.id, !!params?.id && params?.id !== 'new', @@ -451,7 +461,7 @@ export default function Edit({ params }: { params: { id: string } }) { style={{ backgroundColor: '#FCFCFC', }} - token={params.id} + token={botId} apiDomain={API_HOST} apiUrl="/api/chat/stream_qa" prompt={botProfile?.prompt}