bug fixed
This commit is contained in:
parent
eb542bd923
commit
bf333785b9
|
@ -16,7 +16,7 @@ import {
|
|||
CreateChatDialogData,
|
||||
CreateChatDialogResult
|
||||
} from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component';
|
||||
import { Observable, Subscription, of } from 'rxjs';
|
||||
import { Subscription, of } from 'rxjs';
|
||||
import { Store, select } from '@ngrx/store';
|
||||
|
||||
import * as AppStore from '@app/store';
|
||||
|
@ -28,8 +28,7 @@ import {
|
|||
UserInfoF,
|
||||
UserInfoDN
|
||||
} from '@ucap-webmessenger/protocol-query';
|
||||
import { MatTabChangeEvent, MatTabGroup } from '@angular/material';
|
||||
import { RightDrawer } from '@app/types';
|
||||
import { MatTabChangeEvent } from '@angular/material';
|
||||
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||
import { KEY_LOGIN_RES_INFO } from '@app/types/login-res-info.type';
|
||||
|
@ -38,7 +37,7 @@ import { KEY_VER_INFO } from '@app/types/ver-info.type';
|
|||
import { MessageApiService } from '@ucap-webmessenger/api-message';
|
||||
import { DeviceType } from '@ucap-webmessenger/core';
|
||||
import { UnreadCountRequest } from 'projects/ucap-webmessenger-api-message/src/lib/apis/unread-count';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
import { map, catchError, tap } from 'rxjs/operators';
|
||||
import { MessageStatusCode } from '@ucap-webmessenger/api';
|
||||
|
||||
export enum MainMenu {
|
||||
|
@ -82,6 +81,7 @@ export class LeftSideComponent implements OnInit, OnDestroy {
|
|||
|
||||
sessionVerinfo: VersionInfo2Response;
|
||||
loginRes: LoginResponse;
|
||||
loginResSubscription: Subscription;
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
|
@ -90,9 +90,6 @@ export class LeftSideComponent implements OnInit, OnDestroy {
|
|||
private messageApiService: MessageApiService,
|
||||
private logger: NGXLogger
|
||||
) {
|
||||
this.loginRes = this.sessionStorageService.get<LoginResponse>(
|
||||
KEY_LOGIN_RES_INFO
|
||||
);
|
||||
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
||||
KEY_VER_INFO
|
||||
);
|
||||
|
@ -107,6 +104,15 @@ export class LeftSideComponent implements OnInit, OnDestroy {
|
|||
this.badgeChatUnReadCount = count;
|
||||
});
|
||||
|
||||
this.loginResSubscription = this.store
|
||||
.pipe(
|
||||
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
|
||||
tap(loginRes => {
|
||||
this.loginRes = loginRes;
|
||||
})
|
||||
)
|
||||
.subscribe();
|
||||
|
||||
this.getMessageUnreadCount();
|
||||
this.badgeMessageInterval = setInterval(
|
||||
() => this.getMessageUnreadCount(),
|
||||
|
@ -124,6 +130,9 @@ export class LeftSideComponent implements OnInit, OnDestroy {
|
|||
if (!!this.badgeMessageUnReadCountSubscription) {
|
||||
this.badgeMessageUnReadCountSubscription.unsubscribe();
|
||||
}
|
||||
if (!!this.loginResSubscription) {
|
||||
this.loginResSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
if (!!this.badgeMessageInterval) {
|
||||
clearInterval(this.badgeMessageInterval);
|
||||
|
|
|
@ -62,7 +62,6 @@ export class ImageDirective implements OnInit, AfterViewInit, OnChanges {
|
|||
|
||||
if (!!pathChanges && !pathChanges.firstChange) {
|
||||
this.loadImage();
|
||||
this.logger.debug('ucapImage.ngOnChanges', changes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user