diff --git a/web/app/components/base/chat/chat-with-history/hooks.tsx b/web/app/components/base/chat/chat-with-history/hooks.tsx index 7b6780761a..63c629cf96 100644 --- a/web/app/components/base/chat/chat-with-history/hooks.tsx +++ b/web/app/components/base/chat/chat-with-history/hooks.tsx @@ -221,6 +221,12 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => { handleNewConversationInputsChange(conversationInputs) }, [handleNewConversationInputsChange, inputsForms]) + // when inputForms is empty, ConfigPanel set hide + useEffect(() => { + if (!inputsForms || inputsForms.length === 0) + setShowConfigPanelBeforeChat(false) + }, [inputsForms, setShowConfigPanelBeforeChat]) + const { data: newConversation } = useSWR(newConversationId ? [isInstalledApp, appId, newConversationId] : null, () => generationConversationName(isInstalledApp, appId, newConversationId), { revalidateOnFocus: false }) const [originConversationList, setOriginConversationList] = useState([]) useEffect(() => { diff --git a/web/app/components/base/chat/embedded-chatbot/hooks.tsx b/web/app/components/base/chat/embedded-chatbot/hooks.tsx index 5e13cf77b7..5a0a70f007 100644 --- a/web/app/components/base/chat/embedded-chatbot/hooks.tsx +++ b/web/app/components/base/chat/embedded-chatbot/hooks.tsx @@ -311,6 +311,12 @@ export const useEmbeddedChatbot = () => { notify({ type: 'success', message: t('common.api.success') }) }, [isInstalledApp, appId, t, notify]) + // when inputForms is empty, ConfigPanel set hide + useEffect(() => { + if (!inputsForms || inputsForms.length === 0) + setShowConfigPanelBeforeChat(false) + }, [inputsForms, setShowConfigPanelBeforeChat]) + return { appInfoError, appInfoLoading,