Skip to content

Commit

Permalink
perf: 优化多个会话中断其中一个互相影响的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
huailei000 committed Aug 17, 2023
1 parent e95d02a commit ea22ce7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions ui/src/views/chat/components/Content/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ const {
} = useChat()
const chatStore = useChatStore()
const $axios = inject("$axios")
const currentConversationId = ref('')
const env = import.meta.env
const currentActiveChat = computed(() => chatStore.activeChat)
const currentConversationId = computed(() => chatStore.activeChat.conversation_id)
const onWebSocketMessage = (data) => {
currentConversationId.value = data?.conversation_id
const types = ['waiting', 'reject', 'error', 'finish']
if (types.includes(data.type)) {
onSystemMessage(data)
Expand Down
4 changes: 3 additions & 1 deletion ui/src/views/chat/hooks/useChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function useChat() {

const addChatConversationById = (chat) => {
chatStore.addConversationToActiveChat(chat)
chatStore.setActiveChatConversationId(chat?.conversation_id)
if (chat?.conversation_id) {
chatStore.setActiveChatConversationId(chat.conversation_id)
}
pageScroll('scrollRef')
}

Expand Down

0 comments on commit ea22ce7

Please sign in to comment.