add user list

This commit is contained in:
Peter Maquiran
2022-01-11 13:03:43 +01:00
parent 3b370996b5
commit a8a1307bec
4 changed files with 153 additions and 92 deletions
+29 -26
View File
@@ -12,6 +12,7 @@ import {
import { ModalController, Platform } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { ChatService as ChatServiceGPR} from 'src/app/services/chat/chat.service'
import { GroupMessagesPage } from './group-messages/group-messages.page';
import { ContactsPage } from './messages/contacts/contacts.page';
import { MessagesPage } from './messages/messages.page';
@@ -123,9 +124,11 @@ export class ChatPage implements OnInit {
private router: Router,
private sqlservice: SqliteService,
private platform: Platform,
private storageservice: StorageService
private storageservice: StorageService,
public ChatServiceGPR: ChatServiceGPR
) {
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.headers = new HttpHeaders();
window.onresize = (event) => {
@@ -142,44 +145,44 @@ export class ChatPage implements OnInit {
this.segment = "Contactos";
this.authService.userData$.subscribe((res: any) => {
this.loggedUser = res;
console.log(this.loggedUser);
this.load();
// this.authService.userData$.subscribe((res: any) => {
// this.loggedUser = res;
// console.log(this.loggedUser);
// this.load();
this.getDirectMessagesDB();
});
// // this.getDirectMessagesDB();
// });
/* websocket functions */
//this.sendMsg();
/* Fim websocket functions */
this.hideRefreshButton();
this.getChatMembers();
// this.hideRefreshButton();
// this.getChatMembers();
//Teste
let t = this.showDateDuration(new Date());
console.log(t);
// let t = this.showDateDuration(new Date());
// console.log(t);
this.setStatus('away');
// this.setStatus('away');
/* if(this.dataService.get("newGroup")){
this.openNewGroupPage();
} */
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
if (this.dataService.get("newGroup")) {
this.openNewGroupPage();
}
else{
this.closeAllDesktopComponents();
this.showEmptyComponent = true;
}
}
else{
this.dataService.set("newGroup", false);
}
});
// this.router.events.forEach((event) => {
// if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
// if (this.dataService.get("newGroup")) {
// this.openNewGroupPage();
// }
// else{
// this.closeAllDesktopComponents();
// this.showEmptyComponent = true;
// }
// }
// else{
// this.dataService.set("newGroup", false);
// }
// });
}
numSequence(n: number): Array<number> {