diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts index b013d799..6939b149 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts @@ -3,7 +3,8 @@ import { OnInit, ViewChild, ViewChildren, - QueryList + QueryList, + OnDestroy } from '@angular/core'; import { Observable, combineLatest, Subscription } from 'rxjs'; @@ -44,7 +45,7 @@ import { KEY_VER_INFO } from '@app/types/ver-info.type'; styleUrls: ['./group.component.scss'], animations: ucapAnimations }) -export class GroupComponent implements OnInit { +export class GroupComponent implements OnInit, OnDestroy { @ViewChild('groupExpansionPanel', { static: true }) groupExpansionPanel: GroupExpansionPanelComponent; @@ -134,6 +135,12 @@ export class GroupComponent implements OnInit { ); } + ngOnDestroy(): void { + if (!!this.loginResSubscription) { + this.loginResSubscription.unsubscribe(); + } + } + async onClickGroupMenu(menuType: string) { this.logger.debug('menuType', menuType); switch (menuType) {