changes on Rocket Chat authentication

This commit is contained in:
tiago.kayaya
2021-06-04 11:37:56 +01:00
parent 716562e357
commit 19f270f425
6 changed files with 55 additions and 37 deletions
+6 -1
View File
@@ -90,6 +90,8 @@ export class ChatPage implements OnInit {
/* Fim websockets variables*/
loggedUserChat:any;
constructor(
private http:HttpClient,
private chatService: ChatService,
@@ -98,11 +100,14 @@ export class ChatPage implements OnInit {
private storage:Storage,
private resolver: ComponentFactoryResolver,
){
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.headers = new HttpHeaders();
this.loadMessage();
}
ngOnInit() {
console.log(this.loggedUserChat);
this.segment = "Contactos";
this.authService.userData$.subscribe((res:any)=>{
@@ -255,7 +260,7 @@ sendMsg() {
}
getChatMembers(){
this.chatService.getMembers(this.userDirectMessages[0]._id).subscribe(res=> {
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
this.dmUsers = res['members'].filter(data => data.username != this.loggedUserChat.me.username)
});
}
getGroups(){