diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts index b3cca3fc..acd4ffc8 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts @@ -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) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts index 52acab5e..bf2db933 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/right-drawer/room-user-list.component.ts @@ -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) {