新会话调整

This commit is contained in:
dong 2023-05-23 18:11:28 +08:00
parent 6c8ae4f763
commit 248f2a767a

View File

@ -366,20 +366,19 @@ export default {
}, },
sendPrivateMsg(item) { sendPrivateMsg(item) {
this.privateChatId = item.id; this.privateChatId = item.id;
const mList = [
{memberId: this.myMemberId, connect: false, role: 'Leader'},
{memberId: item.id, connect: false, role: 'Leader'}
];
const findIndex = this.groupList.findIndex(ii => { const findIndex = this.groupList.findIndex(ii => {
return ii.type == 'PRIVATE_CHAT' && ii.memberList.find(m => { return ii.type == 'PRIVATE_CHAT' && this.isEqualMember(ii.memberList, mList);
return m.memberId == item.id;
});
}); });
let index = findIndex; let index = findIndex;
if (findIndex < 0) { if (findIndex < 0) {
const obj = { const obj = {
creatorId: this.myMemberId, creatorId: this.myMemberId,
leaderId: this.myMemberId, leaderId: this.myMemberId,
memberList: [ memberList: mList,
{memberId: this.myMemberId, connect: false, role: 'Leader'},
{memberId: item.id, connect: false, role: 'Leader'}
],
messageList: [], messageList: [],
name: item.labelName, name: item.labelName,
type: 'PRIVATE_CHAT' type: 'PRIVATE_CHAT'