From 957306e71a5824b77107ec98a4e3e3bfbbca9ebe Mon Sep 17 00:00:00 2001 From: bob <312777916@qq.com> Date: Mon, 28 Oct 2024 22:34:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3bug=EF=BC=9AhasNoMoreMsg?= =?UTF-8?q?=E5=8F=AA=E6=9C=89=E9=A6=96=E6=AC=A1=E7=82=B9=E5=87=BBsession?= =?UTF-8?q?=E6=9C=89=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/message/MessageItem.vue | 1 - src/stores/message.js | 1 + src/views/message/MessageLayout.vue | 10 +++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/message/MessageItem.vue b/src/components/message/MessageItem.vue index 727cf28..beae715 100644 --- a/src/components/message/MessageItem.vue +++ b/src/components/message/MessageItem.vue @@ -89,7 +89,6 @@ const msgTime = computed(() => { }) const onLoadMore = () => { - loadMoreTips.value = '' emit('loadMore') } diff --git a/src/stores/message.js b/src/stores/message.js index 6c326e7..9bbc62d 100644 --- a/src/stores/message.js +++ b/src/stores/message.js @@ -51,6 +51,7 @@ export const messageStore = defineStore('anyim-message', () => { if ('remoteRead' in obj) mySession.remoteRead = obj.remoteRead if ('readMsgId' in obj) mySession.readMsgId = obj.readMsgId if ('readTime' in obj) mySession.readTime = obj.readTime + if ('noMoreMsg' in obj) mySession.noMoreMsg = obj.noMoreMsg if ('objectInfo' in obj) mySession.objectInfo = obj.objectInfo if (flag) { diff --git a/src/views/message/MessageLayout.vue b/src/views/message/MessageLayout.vue index 7e2dc7b..8329ebf 100644 --- a/src/views/message/MessageLayout.vue +++ b/src/views/message/MessageLayout.vue @@ -65,7 +65,9 @@ const newMsgTips = ref({ }) const lastReadMsgId = ref() -const hasNoMoreMsg = ref(false) +const hasNoMoreMsg = computed(() => { + return selectedSession.value.noMoreMsg || false +}) const isLoadMoreLoading = ref(false) const isLoading = ref(false) const isShowReturnBottom = ref(false) @@ -84,7 +86,6 @@ const startIndex = computed(() => { const reset = () => { capacity.value = 15 msgListReachBottom(false) - hasNoMoreMsg.value = false isLoadMoreLoading.value = false isLoading.value = false isShowReturnBottom.value = false @@ -312,7 +313,10 @@ const pullMsg = async (mode = 0, ref = -1) => { } if (msgCount < pageSize) { - hasNoMoreMsg.value = true + messageData.updateSession({ + sessionId: selectedSessionId.value, + noMoreMsg: true + }) } if (mode === 0) isLoading.value = false