File tree 1 file changed +7
-0
lines changed
src/views/chat/layout/sider
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang='ts'>
2
2
import { computed , onMounted , ref } from ' vue'
3
3
import { NInput , NPopconfirm , NScrollbar , NSpin } from ' naive-ui'
4
+ import { useScroll } from ' ../../hooks/useScroll'
4
5
import { SvgIcon } from ' @/components/common'
5
6
import { useAppStore , useChatStore } from ' @/store'
6
7
import { useBasicLayout } from ' @/hooks/useBasicLayout'
7
8
import { useAuthStoreWithout } from ' @/store/modules/auth'
8
9
import { debounce } from ' @/utils/functions/debounce'
9
10
11
+ const { scrollToBottom } = useScroll ()
10
12
const { isMobile } = useBasicLayout ()
11
13
12
14
const appStore = useAppStore ()
@@ -26,6 +28,11 @@ async function handleSyncChatRoom() {
26
28
loadingRoom .value = true
27
29
chatStore .syncHistory (() => {
28
30
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
+ }
29
36
})
30
37
}
31
38
You can’t perform that action at this time.
0 commit comments