From 7d86529796ffb6c0c72b66120891aed32435e12e Mon Sep 17 00:00:00 2001 From: leejinho Date: Tue, 25 Feb 2020 17:25:17 +0900 Subject: [PATCH] =?UTF-8?q?#=20=EC=9D=B4=EC=8A=88=EC=B2=98=EB=A6=AC=20234?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-sidenav/group.component.ts | 250 +++++++++--------- .../environments/environment.daesang.dev.ts | 2 +- 2 files changed, 127 insertions(+), 125 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts index 3d210d7a..e6360240 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts @@ -483,7 +483,7 @@ export class GroupComponent implements OnInit, OnDestroy { return true; } - async onClickProfileContextMenu( + onClickProfileContextMenu( menuType: string, userInfo: UserInfo | UserInfoF, group?: GroupDetailData @@ -497,142 +497,144 @@ export class GroupComponent implements OnInit, OnDestroy { 'group', group ); - switch (menuType) { - case 'VIEW_PROFILE': - this.onClickOpenProfile(userInfo.seq, group); - break; - case 'CHAT': - this.onSelectBuddy(userInfo); - break; - case 'REMOVE_FROM_GROUP': - { - const result = await this.dialogService.open< - ConfirmDialogComponent, - ConfirmDialogData, - ConfirmDialogResult - >(ConfirmDialogComponent, { - width: '360px', - data: { - title: this.translateService.instant( - 'group.removeBuddyFromGroup' - ), - html: this.translateService.instant( - 'group.confirmRemoveBuddyFromGroupInContextMenu', - { - target: `${userInfo.name} ${userInfo.grade}`, - targetGroup: `${group.name}` - } - ) - } - }); - - if (!!result && !!result.choice && result.choice) { - const trgtUserSeq = group.userSeqs.filter( - user => user !== userInfo.seq - ); - this.store.dispatch( - SyncStore.updateGroupMember({ - oldGroup: group, - trgtUserSeq - }) - ); - } - } - break; - case 'COPY_BUDDY': - { - const result = await this.dialogService.open< - SelectGroupDialogComponent, - SelectGroupDialogData, - SelectGroupDialogResult - >(SelectGroupDialogComponent, { - width: '600px', - data: { - title: this.translateService.instant('group.selectTargetGroup') - } - }); - - if (!!result && !!result.choice && result.choice) { - if (!!result.group) { - const oldGroup: GroupDetailData = result.group; - const trgtUserSeq: number[] = []; - let exist = false; - result.group.userSeqs.map(seq => { - trgtUserSeq.push(seq); - if (seq === userInfo.seq) { - exist = true; - } - }); - - if (!exist) { - trgtUserSeq.push(userInfo.seq); + this.ngZone.run(async () => { + switch (menuType) { + case 'VIEW_PROFILE': + this.onClickOpenProfile(userInfo.seq, group); + break; + case 'CHAT': + this.onSelectBuddy(userInfo); + break; + case 'REMOVE_FROM_GROUP': + { + const result = await this.dialogService.open< + ConfirmDialogComponent, + ConfirmDialogData, + ConfirmDialogResult + >(ConfirmDialogComponent, { + width: '360px', + data: { + title: this.translateService.instant( + 'group.removeBuddyFromGroup' + ), + html: this.translateService.instant( + 'group.confirmRemoveBuddyFromGroupInContextMenu', + { + target: `${userInfo.name} ${userInfo.grade}`, + targetGroup: `${group.name}` + } + ) } + }); + if (!!result && !!result.choice && result.choice) { + const trgtUserSeq = group.userSeqs.filter( + user => user !== userInfo.seq + ); this.store.dispatch( SyncStore.updateGroupMember({ - oldGroup, + oldGroup: group, trgtUserSeq }) ); } } - } - break; - case 'MOVE_BUDDY': - { - const result = await this.dialogService.open< - SelectGroupDialogComponent, - SelectGroupDialogData, - SelectGroupDialogResult - >(SelectGroupDialogComponent, { - width: '600px', - data: { - title: this.translateService.instant('group.selectTargetGroup'), - ignoreGroup: [group] - } - }); + break; + case 'COPY_BUDDY': + { + const result = await this.dialogService.open< + SelectGroupDialogComponent, + SelectGroupDialogData, + SelectGroupDialogResult + >(SelectGroupDialogComponent, { + width: '600px', + data: { + title: this.translateService.instant('group.selectTargetGroup') + } + }); - if (!!result && !!result.choice && result.choice) { - if (!!result.group) { - this.store.dispatch( - SyncStore.moveGroupMember({ - fromGroup: group, - toGroup: result.group, - trgtUserSeq: [userInfo.seq] - }) - ); + if (!!result && !!result.choice && result.choice) { + if (!!result.group) { + const oldGroup: GroupDetailData = result.group; + const trgtUserSeq: number[] = []; + let exist = false; + result.group.userSeqs.map(seq => { + trgtUserSeq.push(seq); + if (seq === userInfo.seq) { + exist = true; + } + }); + + if (!exist) { + trgtUserSeq.push(userInfo.seq); + } + + this.store.dispatch( + SyncStore.updateGroupMember({ + oldGroup, + trgtUserSeq + }) + ); + } } } - } - break; - case 'REGISTER_FAVORITE': - this.store.dispatch( - SyncStore.updateBuddy({ - seq: userInfo.seq, - isFavorit: !userInfo.isFavorit - }) - ); - break; - case 'SEND_MESSAGE': - { - this.dialogService.open< - MessageWriteDialogComponent, - MessageWriteDialogData, - MessageWriteDialogResult - >(MessageWriteDialogComponent, { - width: '600px', - height: '600px', - disableClose: true, - hasBackdrop: false, - data: { - loginRes: this.loginRes, - environmentsInfo: this.environmentsInfo, - receiverList: [userInfo] + break; + case 'MOVE_BUDDY': + { + const result = await this.dialogService.open< + SelectGroupDialogComponent, + SelectGroupDialogData, + SelectGroupDialogResult + >(SelectGroupDialogComponent, { + width: '600px', + data: { + title: this.translateService.instant('group.selectTargetGroup'), + ignoreGroup: [group] + } + }); + + if (!!result && !!result.choice && result.choice) { + if (!!result.group) { + this.store.dispatch( + SyncStore.moveGroupMember({ + fromGroup: group, + toGroup: result.group, + trgtUserSeq: [userInfo.seq] + }) + ); + } } - }); - } - break; - } + } + break; + case 'REGISTER_FAVORITE': + this.store.dispatch( + SyncStore.updateBuddy({ + seq: userInfo.seq, + isFavorit: !userInfo.isFavorit + }) + ); + break; + case 'SEND_MESSAGE': + { + this.dialogService.open< + MessageWriteDialogComponent, + MessageWriteDialogData, + MessageWriteDialogResult + >(MessageWriteDialogComponent, { + width: '600px', + height: '600px', + disableClose: true, + hasBackdrop: false, + data: { + loginRes: this.loginRes, + environmentsInfo: this.environmentsInfo, + receiverList: [userInfo] + } + }); + } + break; + } + }); } onClickOpenProfile(userSeq: number, group: GroupDetailData) { diff --git a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts index 74d15095..ef2ba64d 100644 --- a/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts +++ b/projects/ucap-webmessenger-app/src/environments/environment.daesang.dev.ts @@ -81,7 +81,7 @@ export const environment: Environment = { maxChatRoomUser: 300, masstextLength: 800, - eventRequestInitCount: 15, + eventRequestInitCount: 30, eventRequestDefaultCount: 50, readHereShowMinimumEventCount: 10,