fix bug in create new room

This commit is contained in:
tiago.kayaya
2022-01-26 16:37:59 +01:00
parent 81632c5296
commit 2ab70edd9d
6 changed files with 117 additions and 39 deletions
+2 -1
View File
@@ -39,7 +39,7 @@ export class RoomService {
private sqlservice: SqliteService,
) { }
setData({ customFields, id, name, t, lastMessage, _updatedAt }) {
setData({ customFields, id, name, t, lastMessage = new MessageService(), _updatedAt }) {
this.customFields = customFields
this.id = id
this.name = name
@@ -62,6 +62,7 @@ export class RoomService {
/* this.ToastService._chatMessage({message:'Nova mensagem', sender:'Gilson'}) */
const message = new MessageService()
message.setData(ChatMessage)
this.lastMessage.msg = message.msg
if (message.t == 'r') { this.name = message.msg }
this.calDateDuration(ChatMessage._updatedAt)