diff --git a/api/migrations/versions/2025_07_08_0001_add_always_new_chat.py b/api/migrations/versions/2025_07_08_0001_add_always_new_chat.py index 6a2c136cc6..0310e37fa7 100644 --- a/api/migrations/versions/2025_07_08_0001_add_always_new_chat.py +++ b/api/migrations/versions/2025_07_08_0001_add_always_new_chat.py @@ -1,7 +1,7 @@ """add always_new_chat boolean field to apps and sites (default true) Revision ID: 0001_add_always_new_chat -Revises: +Revises: Create Date: 2025-07-08 00:00:00.000000 """ @@ -21,4 +21,4 @@ def upgrade(): def downgrade(): for table in ('apps', 'sites'): - op.drop_column(table, 'always_new_chat') \ No newline at end of file + op.drop_column(table, 'always_new_chat') diff --git a/web/app/components/base/chat/embedded-chatbot/hooks.tsx b/web/app/components/base/chat/embedded-chatbot/hooks.tsx index 8bafefbd10..8147a9ec30 100644 --- a/web/app/components/base/chat/embedded-chatbot/hooks.tsx +++ b/web/app/components/base/chat/embedded-chatbot/hooks.tsx @@ -120,6 +120,7 @@ export const useEmbeddedChatbot = () => { defaultValue: {}, }) const allowResetChat = !conversationId + const [userSelectedConversation, setUserSelectedConversation] = useState(false) const currentConversationId = useMemo(() => { if (appData?.site?.always_new_chat && !userSelectedConversation) return '' @@ -164,8 +165,6 @@ export const useEmbeddedChatbot = () => { ) const [showNewConversationItemInList, setShowNewConversationItemInList] = useState(false) - const [userSelectedConversation, setUserSelectedConversation] = useState(false) - const pinnedConversationList = useMemo(() => { return appPinnedConversationData?.data || [] }, [appPinnedConversationData])