bugfix :: 쪽지 전송시 연속클릭 방지

This commit is contained in:
leejinho 2020-02-14 15:33:44 +09:00
parent 0686c1d512
commit 27654303a0
4 changed files with 16 additions and 4 deletions

View File

@ -19,6 +19,7 @@
[detailContents]="data.detailContents" [detailContents]="data.detailContents"
[curReceiverList]="curReceiverList" [curReceiverList]="curReceiverList"
[fileAllowSize]="fileAllowSize" [fileAllowSize]="fileAllowSize"
[sendProcessing]="sendProcessing"
(send)="onSend($event)" (send)="onSend($event)"
(selectReceiver)="onSelectReceiver($event)" (selectReceiver)="onSelectReceiver($event)"
(cancel)="onCancel()" (cancel)="onCancel()"

View File

@ -82,6 +82,8 @@ export class MessageWriteDialogComponent implements OnInit {
isModify = false; isModify = false;
sendProcessing = false;
constructor( constructor(
public dialogRef: MatDialogRef< public dialogRef: MatDialogRef<
MessageWriteDialogData, MessageWriteDialogData,
@ -150,6 +152,8 @@ export class MessageWriteDialogComponent implements OnInit {
} }
} }
onNewSend(message: Message) { onNewSend(message: Message) {
this.sendProcessing = true;
this.messageApiService this.messageApiService
.sendMessage({ .sendMessage({
...message, ...message,
@ -162,6 +166,7 @@ export class MessageWriteDialogComponent implements OnInit {
.pipe(take(1)) .pipe(take(1))
.subscribe( .subscribe(
res => { res => {
this.sendProcessing = false;
if (!!res && res.responseCode === MessageStatusCode.Success) { if (!!res && res.responseCode === MessageStatusCode.Success) {
let msg = ''; let msg = '';
if (!!message.reservationTime) { if (!!message.reservationTime) {
@ -265,6 +270,8 @@ export class MessageWriteDialogComponent implements OnInit {
); );
} }
onModifySend(message: MessageModify) { onModifySend(message: MessageModify) {
this.sendProcessing = true;
this.messageApiService this.messageApiService
.editReservationMessageEx({ .editReservationMessageEx({
...message, ...message,
@ -276,6 +283,7 @@ export class MessageWriteDialogComponent implements OnInit {
.pipe(take(1)) .pipe(take(1))
.subscribe( .subscribe(
res => { res => {
this.sendProcessing = false;
if (!!res && res.responseCode === MessageStatusCode.Success) { if (!!res && res.responseCode === MessageStatusCode.Success) {
this.snackBarService.open( this.snackBarService.open(
this.translateService.instant( this.translateService.instant(

View File

@ -82,8 +82,7 @@
class="attach-file-list" class="attach-file-list"
> >
<div class="attach-file"> <div class="attach-file">
<span class="mdi mdi-attachment mdi-18px"> </span <span class="mdi mdi-attachment mdi-18px"> </span>
>
<span class="file-name">{{ oldAttachment.resContent }}</span> <span class="file-name">{{ oldAttachment.resContent }}</span>
<button <button
mat-button mat-button
@ -156,7 +155,8 @@
!receiverList || !receiverList ||
0 === receiverList.length || 0 === receiverList.length ||
0 === contentLength || 0 === contentLength ||
1000 < contentLength 1000 < contentLength ||
!!sendProcessing
" "
class="mat-primary" class="mat-primary"
> >
@ -170,7 +170,8 @@
!receiverList || !receiverList ||
0 === receiverList.length || 0 === receiverList.length ||
0 === contentLength || 0 === contentLength ||
1000 < contentLength 1000 < contentLength ||
!!sendProcessing
" "
class="mat-primary" class="mat-primary"
> >

View File

@ -96,6 +96,8 @@ export class WriteComponent implements OnInit, OnDestroy, AfterViewInit {
isModify = false; isModify = false;
@Input() @Input()
fileAllowSize: number; fileAllowSize: number;
@Input()
sendProcessing = false;
@Output() @Output()
send = new EventEmitter<Message | MessageModify>(); send = new EventEmitter<Message | MessageModify>();