diff --git a/components/uni-im-msg-list/uni-im-msg-list.vue b/components/uni-im-msg-list/uni-im-msg-list.vue index 90a060da31220fed756a95db8d1d0e6fd901b22b..80e16490eedb9419883e30c3fede2a3b9052cad1 100644 --- a/components/uni-im-msg-list/uni-im-msg-list.vue +++ b/components/uni-im-msg-list/uni-im-msg-list.vue @@ -185,13 +185,19 @@ 'conversation.has_unread_group_notification': { async handler(hasUnreadGroupNotification) { const group_notification = this.conversation?.group_info?.notification + const conversation_id = this.conversationId // 弹出群公告 if (hasUnreadGroupNotification && group_notification && group_notification.content) { await uniIm.utils.sleep(1000) + // TODO 临时解决,公告还没弹出来就切换会话,导致弹出多次 + if(conversation_id !== this.conversationId){ + return + } // 判断列表中是否已经渲染了此群公告,是则 call 当前用户。否则弹框提示 let groupNotificationMsg = [...this.visibleMsgList].reverse().find(msg => msg.action === 'update-group-info-notification') // console.log('groupNotificationMsg', groupNotificationMsg,this.visibleMsgList); + if (groupNotificationMsg) { this.conversation.call_list.push(groupNotificationMsg._id) this.closeGroupNotification()