unsubscribe add

This commit is contained in:
leejinho 2019-12-03 08:51:49 +09:00
parent 05a52dd1d5
commit d5b6514f48
2 changed files with 9 additions and 1 deletions

View File

@ -10,7 +10,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { Subscription, of } from 'rxjs'; import { Subscription, of } from 'rxjs';
import { Store, select } from '@ngrx/store'; 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 { NGXLogger } from 'ngx-logger';
import * as AppStore from '@app/store'; import * as AppStore from '@app/store';
@ -223,6 +223,7 @@ export class MessageBoxComponent
searchType === MessageSearchType.Contents ? searchStr : '' searchType === MessageSearchType.Contents ? searchStr : ''
} as RetrieveSearchRequest) } as RetrieveSearchRequest)
.pipe( .pipe(
take(1),
map(res => { map(res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
this.currentTotalCount = res.totalCount; this.currentTotalCount = res.totalCount;
@ -256,6 +257,7 @@ export class MessageBoxComponent
pageCount: this.recieveCurrentPage pageCount: this.recieveCurrentPage
} as RetrieveRequest) } as RetrieveRequest)
.pipe( .pipe(
take(1),
map(res => { map(res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
this.currentTotalCount = res.totalCount; this.currentTotalCount = res.totalCount;
@ -282,6 +284,7 @@ export class MessageBoxComponent
pageCount: this.sendCurrentPage pageCount: this.sendCurrentPage
} as RetrieveRequest) } as RetrieveRequest)
.pipe( .pipe(
take(1),
map(res => { map(res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
this.currentTotalCount = res.totalCount; this.currentTotalCount = res.totalCount;
@ -308,6 +311,7 @@ export class MessageBoxComponent
pageCount: this.reservationCurrentPage pageCount: this.reservationCurrentPage
} as RetrieveRequest) } as RetrieveRequest)
.pipe( .pipe(
take(1),
map(res => { map(res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
this.currentTotalCount = res.totalCount; this.currentTotalCount = res.totalCount;
@ -336,6 +340,7 @@ export class MessageBoxComponent
msgId: message.msgId msgId: message.msgId
} as DetailRequest) } as DetailRequest)
.pipe( .pipe(
take(1),
map(async res => { map(async res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
// Badge Refresh in case Receive Message.. // Badge Refresh in case Receive Message..
@ -389,6 +394,7 @@ export class MessageBoxComponent
msgList msgList
} as DelRequest) } as DelRequest)
.pipe( .pipe(
take(1),
map(async res => { map(async res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
} else { } else {
@ -413,6 +419,7 @@ export class MessageBoxComponent
msgId: messageInfo.msgId msgId: messageInfo.msgId
} as CancelReservationRequest) } as CancelReservationRequest)
.pipe( .pipe(
take(1),
map(async res => { map(async res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
} else { } else {

View File

@ -466,6 +466,7 @@ export class MessageDetailDialogComponent implements OnInit {
recvUserList recvUserList
} as CancelRequest) } as CancelRequest)
.pipe( .pipe(
take(1),
map(async res => { map(async res => {
if (res.responseCode === MessageStatusCode.Success) { if (res.responseCode === MessageStatusCode.Success) {
this.receivers = this.receivers.filter( this.receivers = this.receivers.filter(