mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ConversationPage } from './conversation/conversation.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
@@ -12,10 +14,12 @@ export class ChatPage implements OnInit {
|
||||
/* Set segment variable */
|
||||
segment:string;
|
||||
groupList: any[];
|
||||
userConnectedList: any[];
|
||||
result:any;
|
||||
|
||||
constructor(
|
||||
private chatService: ChatService,
|
||||
private modalController: ModalController,
|
||||
private authService: AuthService) { }
|
||||
|
||||
ngOnInit() {
|
||||
@@ -23,17 +27,37 @@ export class ChatPage implements OnInit {
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.loggedUser=res;
|
||||
});
|
||||
/* this.getGroups(); */
|
||||
this.getGroups();
|
||||
this.getConnectedUsers();
|
||||
}
|
||||
onSegmentChange(){
|
||||
this.RefreshEvents();
|
||||
}
|
||||
RefreshEvents(){}
|
||||
/* getGroups(){
|
||||
this.result = this.chatService.getPrivateGroups().subscribe((res:any)=>{
|
||||
this.groupList = res.users;
|
||||
console.log(this.groupList);
|
||||
getGroups(){
|
||||
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
|
||||
this.groupList = res.groups;
|
||||
/* console.log(this.groupList); */
|
||||
|
||||
});
|
||||
}
|
||||
getConnectedUsers(){
|
||||
this.result = this.chatService.getAllConnectedUsers().subscribe((res:any)=>{
|
||||
this.userConnectedList = res.users;
|
||||
console.log(this.userConnectedList);
|
||||
|
||||
});
|
||||
}
|
||||
async starConversation(selectedUser) {
|
||||
const modal = await this.modalController.create({
|
||||
component: ConversationPage,
|
||||
cssClass: 'conversation',
|
||||
backdropDismiss: false,
|
||||
componentProps: {
|
||||
user: selectedUser,
|
||||
}
|
||||
});
|
||||
} */
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user