bugfix :: 대화방 인원이 넘칠경우 막아주는 로직 300명 제한.
This commit is contained in:
parent
f492aaa8f9
commit
eb92529928
@ -1588,7 +1588,32 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||||||
break;
|
break;
|
||||||
case 'ADD_MEMBER':
|
case 'ADD_MEMBER':
|
||||||
{
|
{
|
||||||
const curRoomUser = this.userInfoListSubject.value.filter(
|
const userInfoList = this.userInfoListSubject.value;
|
||||||
|
if (
|
||||||
|
!!userInfoList &&
|
||||||
|
userInfoList.length >=
|
||||||
|
environment.productConfig.CommonSetting.maxChatRoomUser
|
||||||
|
) {
|
||||||
|
this.dialogService.open<
|
||||||
|
AlertDialogComponent,
|
||||||
|
AlertDialogData,
|
||||||
|
AlertDialogResult
|
||||||
|
>(AlertDialogComponent, {
|
||||||
|
data: {
|
||||||
|
title: this.translateService.instant('chat.errors.label'),
|
||||||
|
html: this.translateService.instant(
|
||||||
|
'chat.errors.maxCountOfRoomMemberWith',
|
||||||
|
{
|
||||||
|
maxCount:
|
||||||
|
environment.productConfig.CommonSetting.maxChatRoomUser
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const curRoomUser = userInfoList.filter(
|
||||||
user =>
|
user =>
|
||||||
user.seq !== this.loginResSubject.value.userSeq && user.isJoinRoom
|
user.seq !== this.loginResSubject.value.userSeq && user.isJoinRoom
|
||||||
);
|
);
|
||||||
|
@ -21,7 +21,10 @@ import {
|
|||||||
DialogService,
|
DialogService,
|
||||||
ConfirmDialogComponent,
|
ConfirmDialogComponent,
|
||||||
ConfirmDialogResult,
|
ConfirmDialogResult,
|
||||||
ConfirmDialogData
|
ConfirmDialogData,
|
||||||
|
AlertDialogComponent,
|
||||||
|
AlertDialogData,
|
||||||
|
AlertDialogResult
|
||||||
} from '@ucap-webmessenger/ui';
|
} from '@ucap-webmessenger/ui';
|
||||||
import {
|
import {
|
||||||
SelectGroupDialogComponent,
|
SelectGroupDialogComponent,
|
||||||
@ -43,6 +46,7 @@ import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
|||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatMenuTrigger } from '@angular/material/menu';
|
import { MatMenuTrigger } from '@angular/material/menu';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { environment } from 'projects/ucap-webmessenger-app/src/environments/environment.dev';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layout-chat-right-drawer-room-user-list',
|
selector: 'app-layout-chat-right-drawer-room-user-list',
|
||||||
@ -139,6 +143,29 @@ export class RoomUserListComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onClickAddMember() {
|
async onClickAddMember() {
|
||||||
|
if (
|
||||||
|
!!this.userInfoList &&
|
||||||
|
this.userInfoList.length >=
|
||||||
|
environment.productConfig.CommonSetting.maxChatRoomUser
|
||||||
|
) {
|
||||||
|
this.dialogService.open<
|
||||||
|
AlertDialogComponent,
|
||||||
|
AlertDialogData,
|
||||||
|
AlertDialogResult
|
||||||
|
>(AlertDialogComponent, {
|
||||||
|
data: {
|
||||||
|
title: this.translateService.instant('chat.errors.label'),
|
||||||
|
html: this.translateService.instant(
|
||||||
|
'chat.errors.maxCountOfRoomMemberWith',
|
||||||
|
{
|
||||||
|
maxCount: environment.productConfig.CommonSetting.maxChatRoomUser
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const curRoomUser = this.userInfoList.filter(
|
const curRoomUser = this.userInfoList.filter(
|
||||||
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
|
user => user.seq !== this.loginRes.userSeq && user.isJoinRoom
|
||||||
);
|
);
|
||||||
|
@ -5,6 +5,8 @@ import { Actions, createEffect, ofType } from '@ngrx/effects';
|
|||||||
import { Store, select } from '@ngrx/store';
|
import { Store, select } from '@ngrx/store';
|
||||||
|
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
|
import { environment } from '../../../../environments/environment';
|
||||||
|
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import {
|
import {
|
||||||
tap,
|
tap,
|
||||||
@ -79,6 +81,8 @@ import {
|
|||||||
AlertDialogData,
|
AlertDialogData,
|
||||||
AlertDialogResult
|
AlertDialogResult
|
||||||
} from '@ucap-webmessenger/ui';
|
} from '@ucap-webmessenger/ui';
|
||||||
|
import { ActivatedRouteSnapshot } from '@angular/router';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Effects {
|
export class Effects {
|
||||||
@ -285,6 +289,29 @@ export class Effects {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
exhaustMap(([action, roomInfo]) => {
|
exhaustMap(([action, roomInfo]) => {
|
||||||
|
if (
|
||||||
|
environment.productConfig.CommonSetting.maxChatRoomUser <
|
||||||
|
action.req.userSeqs.length
|
||||||
|
) {
|
||||||
|
this.dialogService.open<
|
||||||
|
AlertDialogComponent,
|
||||||
|
AlertDialogData,
|
||||||
|
AlertDialogResult
|
||||||
|
>(AlertDialogComponent, {
|
||||||
|
data: {
|
||||||
|
title: this.translateService.instant('chat.errors.label'),
|
||||||
|
html: this.translateService.instant(
|
||||||
|
'chat.errors.maxCountOfRoomMemberWith',
|
||||||
|
{
|
||||||
|
maxCount:
|
||||||
|
environment.productConfig.CommonSetting.maxChatRoomUser
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return of(inviteFailure({ error: 'over size room users !!' }));
|
||||||
|
}
|
||||||
|
|
||||||
if (roomInfo.roomType === RoomType.Single) {
|
if (roomInfo.roomType === RoomType.Single) {
|
||||||
// Re Open
|
// Re Open
|
||||||
return this.roomProtocolService.open(action.req).pipe(
|
return this.roomProtocolService.open(action.req).pipe(
|
||||||
@ -454,6 +481,7 @@ export class Effects {
|
|||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
private roomProtocolService: RoomProtocolService,
|
private roomProtocolService: RoomProtocolService,
|
||||||
private sessionStorageService: SessionStorageService,
|
private sessionStorageService: SessionStorageService,
|
||||||
|
private translateService: TranslateService,
|
||||||
private dialogService: DialogService,
|
private dialogService: DialogService,
|
||||||
private logger: NGXLogger
|
private logger: NGXLogger
|
||||||
) {}
|
) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user