Fix duplicate state declaration in embedded chatbot hooks

Removed a duplicate declaration of the userSelectedConversation state in hooks.tsx to prevent potential state inconsistencies. Also made a minor formatting fix in the migration script for consistency.
pull/22059/head
Kalo Chin 11 months ago
parent 9c493a90e4
commit 35c8bd88c7

@ -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])

Loading…
Cancel
Save