提交 255ae957 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修复 置顶会话存在未读公告,且此公告离当前会话最后一条消息在 30...

修复 置顶会话存在未读公告,且此公告离当前会话最后一条消息在 30 条消息之前(这种公告会直接以弹窗展示),且此时快速切换到另一个会话(从插件市场点进来会自动切到指定会话)确会弹出置顶会话的公告内容,但点击后的关闭公告的逻辑不能同步到服务端的问题
上级 75900adf
...@@ -185,13 +185,19 @@ ...@@ -185,13 +185,19 @@
'conversation.has_unread_group_notification': { 'conversation.has_unread_group_notification': {
async handler(hasUnreadGroupNotification) { async handler(hasUnreadGroupNotification) {
const group_notification = this.conversation?.group_info?.notification const group_notification = this.conversation?.group_info?.notification
const conversation_id = this.conversationId
// 弹出群公告 // 弹出群公告
if (hasUnreadGroupNotification && group_notification && group_notification.content) { if (hasUnreadGroupNotification && group_notification && group_notification.content) {
await uniIm.utils.sleep(1000) await uniIm.utils.sleep(1000)
// TODO 临时解决,公告还没弹出来就切换会话,导致弹出多次
if(conversation_id !== this.conversationId){
return
}
// 判断列表中是否已经渲染了此群公告,是则 call 当前用户。否则弹框提示 // 判断列表中是否已经渲染了此群公告,是则 call 当前用户。否则弹框提示
let groupNotificationMsg = [...this.visibleMsgList].reverse().find(msg => msg.action === let groupNotificationMsg = [...this.visibleMsgList].reverse().find(msg => msg.action ===
'update-group-info-notification') 'update-group-info-notification')
// console.log('groupNotificationMsg', groupNotificationMsg,this.visibleMsgList); // console.log('groupNotificationMsg', groupNotificationMsg,this.visibleMsgList);
if (groupNotificationMsg) { if (groupNotificationMsg) {
this.conversation.call_list.push(groupNotificationMsg._id) this.conversation.call_list.push(groupNotificationMsg._id)
this.closeGroupNotification() this.closeGroupNotification()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册