mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -70,8 +70,16 @@ export class ChatPage implements OnInit {
|
||||
/* setInterval(()=>{ */
|
||||
this.getDirectMessages();
|
||||
this.getGroups();
|
||||
this.customRoom();
|
||||
/* }, 2000); */
|
||||
}
|
||||
customRoom(){
|
||||
let params = new HttpParams();
|
||||
params = params.set("types", "c");
|
||||
this.chatService.customsRooms(params).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
getDirectMessages(){
|
||||
this.showLoader = true;
|
||||
|
||||
@@ -117,6 +117,9 @@ export class GroupMessagesPage implements OnInit {
|
||||
component: ChatPopoverPage,
|
||||
cssClass: 'chat-popover',
|
||||
event: ev,
|
||||
componentProps: {
|
||||
room: this.room,
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
@@ -127,7 +130,7 @@ export class GroupMessagesPage implements OnInit {
|
||||
cssClass: 'chat-options-popover',
|
||||
event: ev,
|
||||
componentProps: {
|
||||
roomId: this.room._id,
|
||||
room: this.room,
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
|
||||
@@ -55,19 +55,19 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
/* loginRocketChat(){
|
||||
loginRocketChat(){
|
||||
this.authService.loginChat(this.postData).subscribe((res: any) =>{
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
},(error:any) =>{
|
||||
console.log('Network error');
|
||||
});
|
||||
} */
|
||||
}
|
||||
|
||||
|
||||
|
||||
async Login(){
|
||||
/* try { */
|
||||
try {
|
||||
//Go to our home in home/feed.
|
||||
//this.router.navigate(['/home/events']);
|
||||
if(this.validateInput()){
|
||||
@@ -78,7 +78,7 @@ export class LoginPage implements OnInit {
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt)){
|
||||
/* this.loginRocketChat(); */
|
||||
this.loginRocketChat();
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else
|
||||
@@ -91,9 +91,9 @@ export class LoginPage implements OnInit {
|
||||
//this.toastService.presentToast('Preencha todos campos');
|
||||
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
|
||||
}
|
||||
/* } catch (error) {
|
||||
} catch (error) {
|
||||
error
|
||||
this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema. '+ error);
|
||||
} */
|
||||
this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema. ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user