diff --git a/web/src/pages/next-search/embed-app-modal.tsx b/web/src/pages/next-search/embed-app-modal.tsx index 284416d379..bbe4565303 100644 --- a/web/src/pages/next-search/embed-app-modal.tsx +++ b/web/src/pages/next-search/embed-app-modal.tsx @@ -8,6 +8,7 @@ import { LanguageAbbreviationMap, } from '@/constants/common'; import { useTranslate } from '@/hooks/common-hooks'; +import { useFetchTenantInfo } from '@/hooks/use-user-setting-request'; import { useCallback, useMemo, useState } from 'react'; type IEmbedAppModalProps = { @@ -16,13 +17,14 @@ type IEmbedAppModalProps = { token: string; from: string; setOpen: (e: any) => void; - tenantId: string; beta?: string; }; const EmbedAppModal = (props: IEmbedAppModalProps) => { const { t } = useTranslate('search'); - const { open, setOpen, token = '', from, url, tenantId, beta = '' } = props; + const { data: tenantInfo } = useFetchTenantInfo(); + const tenantId = tenantInfo.tenant_id; + const { open, setOpen, token = '', from, url, beta = '' } = props; const [hideAvatar, setHideAvatar] = useState(false); const [locale, setLocale] = useState(''); diff --git a/web/src/pages/next-search/hooks.ts b/web/src/pages/next-search/hooks.ts index 315ce14eee..c34d7b830a 100644 --- a/web/src/pages/next-search/hooks.ts +++ b/web/src/pages/next-search/hooks.ts @@ -46,8 +46,7 @@ export const useGetSharedSearchParams = () => { const [searchParams] = useSearchParams(); const data_prefix = 'data_'; const data = Object.fromEntries( - searchParams - .entries() + Array.from(searchParams.entries()) .filter(([key]) => key.startsWith(data_prefix)) .map(([key, value]) => [key.replace(data_prefix, ''), value]), ); diff --git a/web/src/pages/next-search/ragflow-log.tsx b/web/src/pages/next-search/ragflow-logo.tsx similarity index 88% rename from web/src/pages/next-search/ragflow-log.tsx rename to web/src/pages/next-search/ragflow-logo.tsx index fbe2f1952c..1c8a367ec9 100644 --- a/web/src/pages/next-search/ragflow-log.tsx +++ b/web/src/pages/next-search/ragflow-logo.tsx @@ -1,7 +1,6 @@ import { useFetchTokenListBeforeOtherStep } from '@/components/embed-dialog/use-show-embed-dialog'; import { Button } from '@/components/ui/button'; import { SharedFrom } from '@/constants/chat'; -import { useFetchTenantInfo } from '@/hooks/use-user-setting-request'; import { cn } from '@/lib/utils'; import { Routes } from '@/routes'; import { Send } from 'lucide-react'; @@ -9,27 +8,14 @@ import { useState } from 'react'; import { useFetchSearchDetail } from '../next-searches/hooks'; import EmbedAppModal from './embed-app-modal'; -export function RAGFlowLogo({ - onClick, -}: { - onClick?: React.MouseEventHandler; -}) { +function EmbedIcon() { const [openEmbed, setOpenEmbed] = useState(false); const { beta, handleOperate } = useFetchTokenListBeforeOtherStep(); - const { data: tenantInfo } = useFetchTenantInfo(); - const tenantId = tenantInfo.tenant_id; + const { data: SearchData } = useFetchSearchDetail(); return ( -
-

- RAGFlow -

+ <>