2019-09-23 05:23:24 +00:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { ucapAnimations } from '@ucap-webmessenger/ui';
|
2019-10-08 04:31:33 +00:00
|
|
|
import { Store, select } from '@ngrx/store';
|
|
|
|
import { NGXLogger } from 'ngx-logger';
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { Info } from '@ucap-webmessenger/protocol-event';
|
|
|
|
|
|
|
|
import * as AppStore from '@app/store';
|
|
|
|
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
|
|
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
|
|
|
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
2019-09-23 05:23:24 +00:00
|
|
|
|
|
|
|
@Component({
|
2019-09-26 02:11:22 +00:00
|
|
|
selector: 'app-layout-messenger-messages',
|
2019-09-23 05:23:24 +00:00
|
|
|
templateUrl: './messages.component.html',
|
|
|
|
styleUrls: ['./messages.component.scss'],
|
|
|
|
animations: ucapAnimations
|
|
|
|
})
|
|
|
|
export class MessagesComponent implements OnInit {
|
2019-10-08 04:31:33 +00:00
|
|
|
loginRes$: Observable<LoginResponse>;
|
|
|
|
eventList$: Observable<Info[]>;
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
private store: Store<any>,
|
|
|
|
private sessionStorageService: SessionStorageService,
|
|
|
|
private logger: NGXLogger
|
|
|
|
) {}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
|
|
|
|
|
|
|
this.loginRes$ = this.store.pipe(
|
|
|
|
select(AppStore.AccountSelector.AuthenticationSelector.loginRes)
|
|
|
|
);
|
2019-09-23 05:23:24 +00:00
|
|
|
|
2019-10-08 04:31:33 +00:00
|
|
|
this.eventList$ = this.store.pipe(
|
|
|
|
select(AppStore.MessengerSelector.EventSelector.infoList)
|
|
|
|
);
|
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
|
|
|
|
selectContact() {}
|
|
|
|
}
|