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
@@ -35,7 +35,6 @@ import { RouteService } from 'src/app/services/route.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { sanitize } from "sanitize-filename-ts";
@Component({
selector: 'app-group-messages',
templateUrl: './group-messages.page.html',
@@ -108,7 +107,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
private file: File,
private fileOpener: FileOpener,
public RouteService: RouteService,
private FileValidatorService: FileValidatorService
private FileValidatorService: FileValidatorService,
private ChangeDetectorRef: ChangeDetectorRef
) {
this.ChatSystemService.getUser()
@@ -137,6 +137,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
open() {
try {
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
@@ -144,6 +146,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.ChatSystemService.openRoom(this.roomId)
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
this.ChatSystemService.getGroupRoom(this.roomId).setChangeDetector(()=> {
this.changeDetector()
})
} catch (error) {
setTimeout(() => {
this.open()
@@ -151,6 +156,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
}
changeDetector = () => {
console.log('run detection page')
this.ChangeDetectorRef.detectChanges()
}
ngOnInit() {
this.loggedUser = this.loggedUserChat;