fix: scroll channel to bottom on activation

This commit is contained in:
Tim
2025-09-01 18:18:58 +08:00
parent 1f30cdfe85
commit edaafdd000

View File

@@ -371,11 +371,12 @@ watch(isConnected, (newValue) => {
}) })
onActivated(async () => { onActivated(async () => {
// 返回页面时:刷新数据与已读,不做强制滚动,保持用户当前位置 // 返回页面时:刷新数据与已读,并滚动到底部
if (currentUser.value) { if (currentUser.value) {
await fetchMessages(0) await fetchMessages(0)
await markConversationAsRead() await markConversationAsRead()
await nextTick() await nextTick()
scrollToBottomSmooth()
updateNearBottom() updateNearBottom()
if (!isConnected.value) { if (!isConnected.value) {
const token = getToken() const token = getToken()