Skip to content
Snippets Groups Projects
Commit 27d4a1c6 authored by BARDET Brian's avatar BARDET Brian
Browse files

Correction pb

parent 3f05c034
Branches
No related tags found
No related merge requests found
...@@ -33,6 +33,7 @@ export class ConversationPage implements OnInit { ...@@ -33,6 +33,7 @@ export class ConversationPage implements OnInit {
getMessages(){ getMessages(){
this.conversationService.messages(this.id).subscribe(data => { this.conversationService.messages(this.id).subscribe(data => {
console.log(data)
this.messages = data.reverse(); this.messages = data.reverse();
setTimeout(()=>{this.updateScroll();},200); setTimeout(()=>{this.updateScroll();},200);
}); });
...@@ -40,7 +41,6 @@ export class ConversationPage implements OnInit { ...@@ -40,7 +41,6 @@ export class ConversationPage implements OnInit {
sendMessage(){ sendMessage(){
this.conversationService.sendMessage(this.text , this.id).subscribe(data => { this.conversationService.sendMessage(this.text , this.id).subscribe(data => {
console.log(data);
this.text = ""; this.text = "";
this.getMessages(); this.getMessages();
}); });
......
...@@ -70,15 +70,20 @@ export class GestionGroupePage implements OnInit { ...@@ -70,15 +70,20 @@ export class GestionGroupePage implements OnInit {
} }
}) })
} }
if(addUser.length > 0) this.gestionGroupeService.addUser(this.id,addUser).subscribe(data => this.router.navigate(['/conversation/' + this.id])); if(addUser.length > 0) this.gestionGroupeService.addUser(this.id,addUser).subscribe(data => { });
if(removeUser.length > 0) this.gestionGroupeService.removeUser(this.id,removeUser).subscribe(data => this.router.navigate(['/conversation/' + this.id])); if(removeUser.length > 0) this.gestionGroupeService.removeUser(this.id,removeUser).subscribe(data => { });
let listeUser = this.usersSelected;
listeUser.push(this.idUser);
let body = { let body = {
"name": name, "name": name,
"description": description, "description": description,
"users": this.usersSelected "users": listeUser
} }
this.gestionGroupeService.updateGroupe(this.id,body).subscribe(data => this.router.navigate(['/conversation/' + this.id])); this.gestionGroupeService.updateGroupe(this.id,body).subscribe(data => this.router.navigate(['/conversation/' + this.id]).then(() => {
window.location.reload();
}));
} }
getGroupe(){ getGroupe(){
......
...@@ -24,7 +24,9 @@ export class NewGroupePage implements OnInit { ...@@ -24,7 +24,9 @@ export class NewGroupePage implements OnInit {
groupe.subscribe(res => { groupe.subscribe(res => {
console.log('groupe crée : ' + JSON.stringify(res)); console.log('groupe crée : ' + JSON.stringify(res));
if(res.name){ if(res.name){
this.router.navigate(['tabs/tab3']); this.router.navigate(['tabs/tab3']).then(() => {
window.location.reload();
});
}else{ }else{
this.alertGroup(); this.alertGroup();
} }
......
...@@ -18,7 +18,9 @@ export class Tab1Page { ...@@ -18,7 +18,9 @@ export class Tab1Page {
disconnect(){ disconnect(){
localStorage.removeItem('token'); localStorage.removeItem('token');
localStorage.removeItem('user'); localStorage.removeItem('user');
this.router.navigate(['login']); this.router.navigate(['login']).then(() => {
window.location.reload();
});
} }
} }
...@@ -12,9 +12,13 @@ export class Tab3Page { ...@@ -12,9 +12,13 @@ export class Tab3Page {
results; results;
constructor(private tab3Service: Tab3Service) { constructor(private tab3Service: Tab3Service) {
}
ngOnInit() {
this.getGroups(); this.getGroups();
} }
getGroups(){ getGroups(){
this.tab3Service.getGroups().subscribe(data => { this.tab3Service.getGroups().subscribe(data => {
this.results = data; this.results = data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment