From e0de51921cab4ccb3c9eac7374d767513c57f548 Mon Sep 17 00:00:00 2001 From: csantosm <4a.santos@gmail.com> Date: Wed, 9 Mar 2022 12:31:36 +0100 Subject: [PATCH] openvidu-components: Forced chat panel updates when new messages --- .../lib/components/panel/chat-panel/chat-panel.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts index 0495fbbf..04ae58a0 100644 --- a/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts +++ b/openvidu-components-angular/projects/openvidu-angular/src/lib/components/panel/chat-panel/chat-panel.component.ts @@ -1,4 +1,4 @@ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core'; import { Subscription } from 'rxjs'; import { ChatMessage } from '../../../models/chat.model'; import { MenuType } from '../../../models/menu.model'; @@ -20,7 +20,7 @@ export class ChatPanelComponent implements OnInit, AfterViewInit { private chatMessageSubscription: Subscription; - constructor(private chatService: ChatService, private menuService: SidenavMenuService) {} + constructor(private chatService: ChatService, private menuService: SidenavMenuService, private cd: ChangeDetectorRef) {} @HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) { @@ -76,6 +76,7 @@ export class ChatPanelComponent implements OnInit, AfterViewInit { this.messageList = messages; if (this.menuService.isMenuOpened()) { this.scrollToBottom(); + this.cd.markForCheck(); } }); }