diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts index fcca0d21..dff61f31 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/message.component.ts @@ -10,7 +10,7 @@ import { } from '@angular/core'; import { Subscription, of } from 'rxjs'; import { Store, select } from '@ngrx/store'; -import { tap, map, catchError } from 'rxjs/operators'; +import { tap, map, catchError, take } from 'rxjs/operators'; import { NGXLogger } from 'ngx-logger'; import * as AppStore from '@app/store'; @@ -223,6 +223,7 @@ export class MessageBoxComponent searchType === MessageSearchType.Contents ? searchStr : '' } as RetrieveSearchRequest) .pipe( + take(1), map(res => { if (res.responseCode === MessageStatusCode.Success) { this.currentTotalCount = res.totalCount; @@ -256,6 +257,7 @@ export class MessageBoxComponent pageCount: this.recieveCurrentPage } as RetrieveRequest) .pipe( + take(1), map(res => { if (res.responseCode === MessageStatusCode.Success) { this.currentTotalCount = res.totalCount; @@ -282,6 +284,7 @@ export class MessageBoxComponent pageCount: this.sendCurrentPage } as RetrieveRequest) .pipe( + take(1), map(res => { if (res.responseCode === MessageStatusCode.Success) { this.currentTotalCount = res.totalCount; @@ -308,6 +311,7 @@ export class MessageBoxComponent pageCount: this.reservationCurrentPage } as RetrieveRequest) .pipe( + take(1), map(res => { if (res.responseCode === MessageStatusCode.Success) { this.currentTotalCount = res.totalCount; @@ -336,6 +340,7 @@ export class MessageBoxComponent msgId: message.msgId } as DetailRequest) .pipe( + take(1), map(async res => { if (res.responseCode === MessageStatusCode.Success) { // Badge Refresh in case Receive Message.. @@ -389,6 +394,7 @@ export class MessageBoxComponent msgList } as DelRequest) .pipe( + take(1), map(async res => { if (res.responseCode === MessageStatusCode.Success) { } else { @@ -413,6 +419,7 @@ export class MessageBoxComponent msgId: messageInfo.msgId } as CancelReservationRequest) .pipe( + take(1), map(async res => { if (res.responseCode === MessageStatusCode.Success) { } else { diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts index 062e74aa..dda9dcc0 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/message/message-detail.dialog.component.ts @@ -466,6 +466,7 @@ export class MessageDetailDialogComponent implements OnInit { recvUserList } as CancelRequest) .pipe( + take(1), map(async res => { if (res.responseCode === MessageStatusCode.Success) { this.receivers = this.receivers.filter(