bugfix 대메뉴간 빠르게 이동시 렉걸리는 문제 수정.

This commit is contained in:
leejinho 2020-04-01 16:17:43 +09:00
parent 3da6832465
commit ecb33fe602
2 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
import { NGXLogger } from 'ngx-logger';
import { ucapAnimations } from '@ucap-webmessenger/ui';
import { Observable, Subscribable, Subscription } from 'rxjs';
import { Observable, Subscribable, Subscription, timer } from 'rxjs';
import { Store, select } from '@ngrx/store';
import * as AppStore from '@app/store';
@ -9,7 +9,7 @@ import * as MessageStore from '@app/store/messenger/message';
import * as SettingsStore from '@app/store/messenger/settings';
import { MatTabChangeEvent } from '@angular/material/tabs';
import { MainMenu } from '@app/types';
import { tap, map } from 'rxjs/operators';
import { tap, map, debounce } from 'rxjs/operators';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
@Component({
@ -69,6 +69,7 @@ export class LeftNaviComponent implements OnInit, OnDestroy {
this.gnbMenuIndexSubscription = this.store
.pipe(select(AppStore.MessengerSelector.SettingsSelector.gnbMenuIndex))
.pipe(debounce(() => timer(300)))
.subscribe(index => {
switch (index) {
case MainMenu.Group:

View File

@ -5,13 +5,13 @@
></app-layout-messenger-intro>
<app-layout-messenger-messages
*ngIf="
!!this.selectedChat &&
(this.gnbMenuIndex$ | async) !== MainMenu.Organization
"
*ngIf="!!this.selectedChat"
(openProfile)="onClickOpenProfile($event)"
(closeRightDrawer)="onCloseRightDrawer()"
(sendCall)="onClickSendClickToCall($event)"
[style.display]="
MainMenu.Organization !== (this.gnbMenuIndex$ | async) ? 'flex' : 'none'
"
></app-layout-messenger-messages>
<!-- 아래와 같이 display 효과를 쓰려면 block 대산 flex 사용. (화면 전환이 매끄럽지만 스크롤이 그대로인 문제 있음.) -->
<app-layout-messenger-organization