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

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; break;
case 'ADD_MEMBER': case 'ADD_MEMBER':
{ {
const curRoomUser = this.userInfoListSubject.value.filter(
user =>
user.seq !== this.loginResSubject.value.userSeq && user.isJoinRoom
);
const result = await this.dialogService.open< const result = await this.dialogService.open<
CreateChatDialogComponent, CreateChatDialogComponent,
CreateChatDialogData, CreateChatDialogData,
@ -1517,15 +1522,27 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
data: { data: {
type: UserSelectDialogType.EditChatMember, type: UserSelectDialogType.EditChatMember,
title: this.translateService.instant('chat.modifyRoomMember'), title: this.translateService.instant('chat.modifyRoomMember'),
curRoomUser: this.userInfoListSubject.value.filter( curRoomUser
user =>
user.seq !== this.loginResSubject.value.userSeq &&
user.isJoinRoom
)
} }
}); });
if (!!result && !!result.choice && result.choice) { 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.. // include me here..
const userSeqs: number[] = this.userInfoListSubject.value const userSeqs: number[] = this.userInfoListSubject.value
.filter(userInfo => userInfo.isJoinRoom) .filter(userInfo => userInfo.isJoinRoom)

View File

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