This commit is contained in:
Richard Park 2020-01-10 10:17:40 +09:00
commit b4727e5691
2 changed files with 23 additions and 6 deletions

View File

@ -8,7 +8,11 @@
<mat-tab [aria-label]="MainMenu.Group"> <mat-tab [aria-label]="MainMenu.Group">
<ng-template mat-tab-label> <ng-template mat-tab-label>
<!--<mat-icon>group</mat-icon>--> <!--<mat-icon>group</mat-icon>-->
<div class="icon-item" matTooltip="Group" matTooltipPosition="after"> <div
class="icon-item"
matTooltip="{{ 'group.label' | translate }}"
matTooltipPosition="after"
>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="24" width="24"
@ -37,7 +41,7 @@
}}" }}"
matBadgeColor="accent" matBadgeColor="accent"
matBadgePosition="above after" matBadgePosition="above after"
matTooltip="Chat" matTooltip="{{ 'chat.label' | translate }}"
matTooltipPosition="after" matTooltipPosition="after"
> >
<svg <svg
@ -63,7 +67,7 @@
<!--<mat-icon>device_hub</mat-icon>--> <!--<mat-icon>device_hub</mat-icon>-->
<div <div
class="icon-item" class="icon-item"
matTooltip="Organization" matTooltip="{{ 'organization.chart' | translate }}"
matTooltipPosition="after" matTooltipPosition="after"
> >
<svg <svg
@ -100,7 +104,7 @@
}}" }}"
matBadgeColor="accent" matBadgeColor="accent"
matBadgePosition="above after" matBadgePosition="above after"
matTooltip="Message" matTooltip="{{ 'message.label' | translate }}"
matTooltipPosition="after" matTooltipPosition="after"
> >
<svg <svg

View File

@ -17,7 +17,7 @@ import {
CreateChatDialogData, CreateChatDialogData,
CreateChatDialogResult CreateChatDialogResult
} from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component'; } from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component';
import { Subscription, Observable } from 'rxjs'; import { Subscription, Observable, merge } from 'rxjs';
import { Store, select } from '@ngrx/store'; import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/store'; import * as AppStore from '@app/store';
@ -49,7 +49,7 @@ import {
} from '@app/types'; } from '@app/types';
import { MessageBoxComponent } from './left-sidenav/message.component'; import { MessageBoxComponent } from './left-sidenav/message.component';
import { environment } from '../../../../environments/environment'; import { environment } from '../../../../environments/environment';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService, LangChangeEvent } from '@ngx-translate/core';
export enum MainMenu { export enum MainMenu {
Group = 'GROUP', Group = 'GROUP',
@ -83,6 +83,8 @@ export class LeftSideComponent implements OnInit, OnDestroy {
@ViewChild('messageBoxComponent', { static: false }) @ViewChild('messageBoxComponent', { static: false })
messageBoxComponent: MessageBoxComponent; messageBoxComponent: MessageBoxComponent;
onLangChangeSubscription: Subscription;
badgeChatUnReadCount: number; badgeChatUnReadCount: number;
badgeChatUnReadCountSubscription: Subscription; badgeChatUnReadCountSubscription: Subscription;
badgeMessageUnReadCount$: Observable<number>; badgeMessageUnReadCount$: Observable<number>;
@ -149,6 +151,14 @@ export class LeftSideComponent implements OnInit, OnDestroy {
this.setFabInitial(MainMenu.Group); this.setFabInitial(MainMenu.Group);
this.currentTabLable = MainMenu.Group; this.currentTabLable = MainMenu.Group;
this.onLangChangeSubscription = merge(
this.translateService.onLangChange,
this.translateService.onDefaultLangChange,
this.translateService.onTranslationChange
).subscribe(() => {
this.setFabInitial(this.currentTabLable);
});
} }
ngOnDestroy(): void { ngOnDestroy(): void {
@ -158,6 +168,9 @@ export class LeftSideComponent implements OnInit, OnDestroy {
if (!!this.loginResSubscription) { if (!!this.loginResSubscription) {
this.loginResSubscription.unsubscribe(); this.loginResSubscription.unsubscribe();
} }
if (!!this.onLangChangeSubscription) {
this.onLangChangeSubscription.unsubscribe();
}
if (!!this.badgeMessageInterval) { if (!!this.badgeMessageInterval) {
clearInterval(this.badgeMessageInterval); clearInterval(this.badgeMessageInterval);