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"
[curReceiverList]="curReceiverList"
[fileAllowSize]="fileAllowSize"
[sendProcessing]="sendProcessing"
(send)="onSend($event)"
(selectReceiver)="onSelectReceiver($event)"
(cancel)="onCancel()"

View File

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

View File

@ -82,8 +82,7 @@
class="attach-file-list"
>
<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>
<button
mat-button
@ -156,7 +155,8 @@
!receiverList ||
0 === receiverList.length ||
0 === contentLength ||
1000 < contentLength
1000 < contentLength ||
!!sendProcessing
"
class="mat-primary"
>
@ -170,7 +170,8 @@
!receiverList ||
0 === receiverList.length ||
0 === contentLength ||
1000 < contentLength
1000 < contentLength ||
!!sendProcessing
"
class="mat-primary"
>

View File

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