message notification is modified

This commit is contained in:
병준 박 2019-12-23 14:47:35 +09:00
parent e417c995ef
commit 77ac22d122

View File

@ -5,7 +5,8 @@ import {
Inject,
OnDestroy,
ViewChild,
ChangeDetectorRef
ChangeDetectorRef,
NgZone
} from '@angular/core';
import { Store, select } from '@ngrx/store';
@ -86,6 +87,7 @@ export class MainPageComponent implements OnInit, OnDestroy {
constructor(
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private store: Store<any>,
private ngZone: NgZone,
private statusProtocolService: StatusProtocolService,
private messageApiService: MessageApiService,
private daesangProtocolService: DaesangProtocolService,
@ -153,39 +155,41 @@ export class MainPageComponent implements OnInit, OnDestroy {
.subscribe(messageSeq => {
console.log(messageSeq);
// this.messageApiService
// .detailMessage({
// userSeq: this.loginRes.userSeq,
// deviceType: this.environmentsInfo.deviceType,
// tokenKey: this.loginRes.tokenString,
// type: MessageType.Receive,
// msgId: Number(messageSeq)
// } as DetailRequest)
// .pipe(
// take(1),
// map(res => {
// if (res.responseCode === MessageStatusCode.Success) {
// // detail view..
// this.dialogService.open<
// MessageDetailDialogComponent,
// MessageDetailDialogData,
// MessageDetailDialogResult
// >(MessageDetailDialogComponent, {
// width: '600px',
// data: {
// detail: res,
// loginRes: this.loginRes,
// environmentsInfo: this.environmentsInfo
// }
// });
this.ngZone.run(() => {
this.messageApiService
.detailMessage({
userSeq: this.loginRes.userSeq,
deviceType: this.environmentsInfo.deviceType,
tokenKey: this.loginRes.tokenString,
type: MessageType.Receive,
msgId: Number(messageSeq)
} as DetailRequest)
.pipe(
take(1),
map(res => {
if (res.responseCode === MessageStatusCode.Success) {
// detail view..
this.dialogService.open<
MessageDetailDialogComponent,
MessageDetailDialogData,
MessageDetailDialogResult
>(MessageDetailDialogComponent, {
width: '600px',
data: {
detail: res,
loginRes: this.loginRes,
environmentsInfo: this.environmentsInfo
}
});
// // this.changeDetectorRef.detectChanges();
// } else {
// }
// }),
// catchError(error => of(this.logger.error(error)))
// )
// .subscribe();
// this.changeDetectorRef.detectChanges();
} else {
}
}),
catchError(error => of(this.logger.error(error)))
)
.subscribe();
});
});
this.loginResSubscription = this.store