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
+9 -2
View File
@@ -48,6 +48,7 @@ export class ChatSystemService {
loadingUsers = false
onRoomsLoad = new Subscribe({ execute: false, deleteOnExecute: true })
private mainChangeDetector: Function = () => {}
constructor(
@@ -66,7 +67,7 @@ export class ChatSystemService {
private AttachmentsService: AttachmentsService,
private NetworkServiceService: NetworkServiceService,
private ViewedMessageService: ViewedMessageService,
private notificationService: NotificationsService
private notificationService: NotificationsService,
) {
@@ -148,9 +149,15 @@ export class ChatSystemService {
});
}
} catch(error) {}
}
setMainChangeDetector(x:Function) {
this.mainChangeDetector = x
}
runMainChangeDetector() {
console.log("change")
this.mainChangeDetector()
}
loadChat() {
+8 -2
View File
@@ -25,6 +25,7 @@ import { ChatSystemService } from './chat-system.service';
import { ViewedMessageService } from './viewed-message.service'
import * as FIFOProcessQueue from 'fifo-process-queue';
import { NotificationsService } from '../notifications.service';
import { ChangeDetectorRef } from '@angular/core';
@Injectable({
providedIn: 'root'
@@ -84,6 +85,7 @@ export class RoomService {
sortRoomList = () => { }
chatServiceDeleteRoom = (roomId) => { }
private changeDetector: Function = () => {}
constructor(
public RochetChatConnectorService: RochetChatConnectorService,
@@ -190,6 +192,11 @@ export class RoomService {
}
setChangeDetector(x:Function) {
console.log("set change detector")
this.changeDetector = x
}
get online() {
if (!this.isGroup) {
@@ -372,8 +379,6 @@ export class RoomService {
}
this.messageUnread = true
// this.sortRoomList()
setTimeout(() => {
this.scrollDown()
}, 50)
@@ -386,6 +391,7 @@ export class RoomService {
this.name = ChatMessage.msg
}
this.changeDetector()
setTimeout(() => {
done()
}, 5)