fix chat rooms list

This commit is contained in:
Peter Maquiran
2022-03-24 17:40:14 +01:00
parent 02950aeca0
commit 7ef93a2aff
7 changed files with 65 additions and 57 deletions
+2
View File
@@ -169,6 +169,8 @@ export class AuthService {
try {
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path
console.log('========================================',guid)
// await this.storage.set(guid.path, message.file.image_url).then(() => {
// console.log('add picture to chat IMAGE SAVED')
// // message.getFileFromDb()
+1
View File
@@ -245,6 +245,7 @@ export class MessageService {
ts: this.attachments[0].ts
}
console.log(this.attachments)
// save the changes to the storage
this.save()
}
+7 -7
View File
@@ -371,6 +371,13 @@ export class RoomService {
console.log(_id,'==',this.messages[i]?._id, true)
this.messages.splice(i, 1)
//Get previous last message from room
const previousLastMessage = this.messages.slice(-1)[0];
this.lastMessage = previousLastMessage;
this.calDateDuration(previousLastMessage._updatedAt)
this.sortRoomList()
if (SessionStore.user.RochetChatUser == this.messages[i].u.username) {
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
@@ -386,13 +393,6 @@ export class RoomService {
await this.messages[i].delateDB()
//Get previous last message from room
const previousLastMessage = this.messages.slice(-1)[0];
this.lastMessage = previousLastMessage;
this.calDateDuration(previousLastMessage._updatedAt)
this.sortRoomList()
return true
} else {