remove expired room

This commit is contained in:
Peter Maquiran
2024-10-07 13:27:49 +01:00
parent d8eb3ddbd6
commit 0dd4fd665b
101 changed files with 698 additions and 4682 deletions
+17 -12
View File
@@ -178,7 +178,7 @@ export class RoomStore {
listenToUpdateMessage() {
this.messageUpdateSubject?.unsubscribe();
console.log('liste to update')
// console.log('liste to update')
this.messageUpdateSubject = this.chatServiceService.listenToUpdateMessage(this.room.id).subscribe((updateMessage) => {
const index = this.messages1[this.room.$id].findIndex(e => e?.id === updateMessage.id); // Use triple equals for comparison
@@ -225,7 +225,12 @@ export class RoomStore {
}
}
this.sendReadMessage()
this.chatServiceService.sendReadAt({
memberId: SessionStore.user.UserId,
messageId: message.id,
requestId: '',
roomId: this.room.id
})
setTimeout(() => {
this.scrollToBottomClicked()
@@ -241,7 +246,7 @@ export class RoomStore {
removeBold() {
if(!this.room?.local) {
this.chatServiceService.removeBoldFromRoom({roomId: this.room.$id})
this.chatServiceService.removeBoldFromRoom({roomId: this.room.id})
}
}
@@ -279,7 +284,7 @@ export class RoomStore {
this.date = {}
const allMessage = [];
console.time("mappingTime");
//console.time("mappingTime");
const sortMessages = messages.value.sort((a, b) => new Date(a.sentAt).getTime() - new Date(b.sentAt).getTime())
for(const message of sortMessages) {
@@ -292,7 +297,7 @@ export class RoomStore {
allMessage.push(new MessageViewModal(message))
}
console.timeEnd("mappingTime");
//console.timeEnd("mappingTime");
this.messages1[this.room.$id]
this.messages1[this.room.$id] = allMessage
@@ -351,7 +356,7 @@ export class RoomStore {
roomId: this.room.id
})
} else {
console.log('no need', message )
// console.log('no need', message )
}
}
}
@@ -417,14 +422,14 @@ export class RoomStore {
if(message.isOk() && this.room.local == IDBoolean.true) {
this.room.local = IDBoolean.false;
// console.log('enter')
// await this.chatServiceService.roomSetLocalToFalseById({
// $roomId: this.room.$id,
// roomId: message.value.roomId
// })
console.log('enter')
await this.chatServiceService.roomSetLocalToFalseById({
$roomId: this.room.$id,
roomId: message.value.roomId
})
this.room.id = message.value.roomId
// this.subscribeToChanges()
this.subscribeToChanges()
}
}