mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix delete member and add member
This commit is contained in:
@@ -63,34 +63,34 @@ export class RoomEntity extends BaseEntity<RoomEntity>(RoomEntitySchema) implem
|
||||
|
||||
if(data.roomType == RoomType.Direct) {
|
||||
this.setName()
|
||||
}
|
||||
|
||||
if(!this.$id) {
|
||||
this.setLocalId()
|
||||
}
|
||||
if(!this.$id) {
|
||||
this.$id = this.getReceiverId()
|
||||
}
|
||||
|
||||
|
||||
if(this.roomType == RoomType.Direct && !this.receiverId && this.members.length == 2) {
|
||||
this.setReceiver()
|
||||
if(!this.receiverId && this.members.length == 2) {
|
||||
this.setReceiver()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// direct room only
|
||||
getReceiverId() {
|
||||
const receiver = this.members?.find((e) => e.user.wxUserId != SessionStore.user.UserId)
|
||||
return receiver.user.wxUserId.toString()
|
||||
}
|
||||
|
||||
// direct room only
|
||||
setLocalId() {
|
||||
const receiver = this.members?.find((e) => e.user.wxUserId != SessionStore.user.UserId)
|
||||
|
||||
if(receiver) {
|
||||
this.$id =receiver.user.wxUserId.toString()
|
||||
}
|
||||
this.$id = this.getReceiverId()
|
||||
}
|
||||
|
||||
// direct room only
|
||||
setReceiver() {
|
||||
const receiver = this.members?.find((e) => e.user.wxUserId != SessionStore.user.UserId)
|
||||
|
||||
if(receiver) {
|
||||
this.receiverId = receiver.user.wxUserId
|
||||
}
|
||||
this.receiverId = parseInt(this.getReceiverId())
|
||||
}
|
||||
|
||||
// direct room only
|
||||
setName() {
|
||||
const userChatName = this.members?.find((e) => e.user.wxUserId != SessionStore.user.UserId)
|
||||
if(userChatName) {
|
||||
|
||||
Reference in New Issue
Block a user