기존대화방에 대화상대 추가시 인원변경 없이 "확인" 을 눌렀을때 아무반응하지 않도록 수정.

This commit is contained in:
leejinho 2020-02-06 15:19:03 +09:00
parent 349eadc316
commit 101a7c86fc
2 changed files with 43 additions and 9 deletions

View File

@ -1508,6 +1508,11 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
break;
case 'ADD_MEMBER':
{
const curRoomUser = this.userInfoListSubject.value.filter(
user =>
user.seq !== this.loginResSubject.value.userSeq && user.isJoinRoom
);
const result = await this.dialogService.open<
CreateChatDialogComponent,
CreateChatDialogData,
@ -1517,15 +1522,27 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
data: {
type: UserSelectDialogType.EditChatMember,
title: this.translateService.instant('chat.modifyRoomMember'),
curRoomUser: this.userInfoListSubject.value.filter(
user =>
user.seq !== this.loginResSubject.value.userSeq &&
user.isJoinRoom
)
curRoomUser
}
});
if (!!result && !!result.choice && result.choice) {
if (
!!result.selectedUserList &&
result.selectedUserList.length > 0 &&
curRoomUser
.map(user => user.seq)
.sort()
.join('|') ===
result.selectedUserList
.map(user => user.seq)
.sort()
.join('|')
) {
// 변경된 것이 없다면 중지.
return;
}
// include me here..
const userSeqs: number[] = this.userInfoListSubject.value
.filter(userInfo => userInfo.isJoinRoom)

View File

@ -138,6 +138,10 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
}
async onClickAddMember() {
const curRoomUser = this.userInfoList.filter(
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
);
const result = await this.dialogService.open<
CreateChatDialogComponent,
CreateChatDialogData,
@ -147,18 +151,31 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
data: {
type: UserSelectDialogType.EditChatMember,
title: this.translateService.instant('chat.modifyRoomMember'),
curRoomUser: this.userInfoList.filter(
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
)
curRoomUser
}
});
if (!!result && !!result.choice && result.choice) {
if (
!!result.selectedUserList &&
result.selectedUserList.length > 0 &&
curRoomUser
.map(user => user.seq)
.sort()
.join('|') ===
result.selectedUserList
.map(user => user.seq)
.sort()
.join('|')
) {
// 변경된 것이 없다면 중지.
return;
}
// include me here..
const userSeqs: number[] = this.userInfoList
.filter(userInfo => userInfo.isJoinRoom)
.map(userInfo => userInfo.seq);
if (!!result.selectedUserList && result.selectedUserList.length > 0) {
result.selectedUserList.forEach(user => {
if (userSeqs.indexOf(user.seq) < 0) {