Merge pull request #248 from zayn-code/chatlist

移动端会话列表:切换tab的时候有时会出现列表一直在加载中
This commit is contained in:
GeekMaser 2025-06-03 09:20:19 +08:00 committed by GitHub
commit e2e24078c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,8 +170,8 @@ checkSession().then((user) => {
}) })
const onLoad = () => { const onLoad = () => {
checkSession().then(() => { checkSession().then((user) => {
httpGet("/api/chat/list?user_id=" + loginUser.value.id).then((res) => { httpGet("/api/chat/list?user_id=" + user.id).then((res) => {
if (res.data) { if (res.data) {
chats.value = res.data; chats.value = res.data;
allChats.value = res.data; allChats.value = res.data;
@ -182,7 +182,9 @@ const onLoad = () => {
error.value = true error.value = true
showFailToast("加载会话列表失败") showFailToast("加载会话列表失败")
}) })
}).catch(() => {}) }).catch(() => {
finished.value = true
})
}; };
const search = () => { const search = () => {