mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
fix mobile
This commit is contained in:
@@ -39,7 +39,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
showLoader: boolean;
|
||||
isGroupCreated:boolean;
|
||||
loggedUser: any;
|
||||
messages:any;
|
||||
|
||||
room:any;
|
||||
roomName:any;
|
||||
@@ -614,7 +613,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
chatmsgArray.push(msgChat)
|
||||
});
|
||||
|
||||
this.messages = chatmsgArray;
|
||||
// this.messages = chatmsgArray;
|
||||
console.log('GROUP CHAT MSG FROM DB', chatmsgArray)
|
||||
})
|
||||
}
|
||||
@@ -673,7 +672,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//this.loadMessages()
|
||||
let msgOnly = res['messages'].filter(data => data.t != 'au');
|
||||
//this.messages = msgOnly.reverse();
|
||||
console.log('MOBILE MSG ROCKET',this.messages);
|
||||
// console.log('MOBILE MSG ROCKET',this.messages);
|
||||
this.transformDataMSG(msgOnly.reverse());
|
||||
this.getRoomMessageDB(this.roomId);
|
||||
// Reconnect in one second
|
||||
|
||||
@@ -49,8 +49,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
canvas: any
|
||||
ctx: any
|
||||
loggedUser: any;
|
||||
message = '';
|
||||
messages: any;
|
||||
userPresence = '';
|
||||
dmUsers: any;
|
||||
roomId: string;
|
||||
@@ -349,31 +347,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": this.roomId, "msg": this.message
|
||||
}
|
||||
}
|
||||
this.chatService.sendMessage(body).subscribe(res => {
|
||||
//this.loadMessages();
|
||||
this.scrollingOnce = true;
|
||||
});
|
||||
this.message = "";
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).send()
|
||||
}
|
||||
|
||||
loadMessages() {
|
||||
this.showLoader = true;
|
||||
const roomId = this.roomId;
|
||||
|
||||
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
|
||||
console.log(res);
|
||||
this.messages = res['messages'].reverse();
|
||||
this.chatMessageStore.add(roomId, this.messages)
|
||||
console.log(this.messages);
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
|
||||
viewDocument(file: any, url?: string) {
|
||||
|
||||
@@ -576,7 +553,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||
//this.addDocGestaoDocumental();
|
||||
}
|
||||
this.loadMessages();
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
@@ -642,7 +619,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
chatmsgArray.push(msgChat)
|
||||
});
|
||||
|
||||
this.messages = chatmsgArray.reverse();
|
||||
|
||||
console.log('CHAT MSG FROM DB', chatmsgArray)
|
||||
})
|
||||
}
|
||||
@@ -717,8 +694,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//showMessage(response.statusText);
|
||||
//this.loadMessages()
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.messages = res['messages'].reverse();
|
||||
this.chatMessageStore.add(roomId, this.messages)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user