Skip to content

Commit 3fb11c6

Browse files
author
Kerwin
committed
fix: 概率聊天历史未加载
1 parent cb4b41d commit 3fb11c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/views/chat/layout/sider/List.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<script setup lang='ts'>
22
import { computed, onMounted, ref } from 'vue'
33
import { NInput, NPopconfirm, NScrollbar, NSpin } from 'naive-ui'
4+
import { useScroll } from '../../hooks/useScroll'
45
import { SvgIcon } from '@/components/common'
56
import { useAppStore, useChatStore } from '@/store'
67
import { useBasicLayout } from '@/hooks/useBasicLayout'
78
import { useAuthStoreWithout } from '@/store/modules/auth'
89
import { debounce } from '@/utils/functions/debounce'
910
11+
const { scrollToBottom } = useScroll()
1012
const { isMobile } = useBasicLayout()
1113
1214
const appStore = useAppStore()
@@ -26,6 +28,11 @@ async function handleSyncChatRoom() {
2628
loadingRoom.value = true
2729
chatStore.syncHistory(() => {
2830
loadingRoom.value = false
31+
// 本来这里不需要的, 但是 vue 渲染的时候 chat 可能优先渲染等原因 导致概率不刷新
32+
if (chatStore.active) {
33+
const uuid = chatStore.active
34+
chatStore.syncChat({ uuid } as Chat.History, undefined, scrollToBottom)
35+
}
2936
})
3037
}
3138

0 commit comments

Comments
 (0)