update chat, make it render

This commit is contained in:
Peter Maquiran
2024-03-07 12:02:59 +01:00
parent a614036b66
commit 84efe58c0a
10 changed files with 169 additions and 18 deletions
+11 -2
View File
@@ -35,6 +35,7 @@ import { NotificationsService } from 'src/app/services/notifications.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { sanitize } from "sanitize-filename-ts";
import { ChangeDetectorRef } from '@angular/core';
@@ -121,7 +122,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private fileOpener: FileOpener,
private router: Router,
public RochetChatConnectorService: RochetChatConnectorService,
private FileValidatorService: FileValidatorService
private FileValidatorService: FileValidatorService,
private ChangeDetectorRef: ChangeDetectorRef
) {
try {
@@ -140,6 +142,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
this.ChatSystemService.openRoom(this.roomId)
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
this.changeDetector()
})
setTimeout(() => {
this.scrollToBottomClicked()
@@ -147,8 +153,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} catch (error) {
//alert(error)
}
}
changeDetector = () => {
console.log('run detection page')
this.ChangeDetectorRef.detectChanges()
}
ngOnInit() {