From ec5c78fb89a369034dea9c0ca4fdc232346a8abb Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 10 Aug 2024 14:06:30 -0400 Subject: [PATCH] Connect --- .../family-connect.component.html | 39 +++++++++++++++++-- .../family-connect.component.ts | 13 ++++++- src/app/services/socket-tools.service.ts | 21 +--------- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/src/app/components/family-connect/family-connect.component.html b/src/app/components/family-connect/family-connect.component.html index 717ac3d..a33494a 100644 --- a/src/app/components/family-connect/family-connect.component.html +++ b/src/app/components/family-connect/family-connect.component.html @@ -14,6 +14,10 @@
+
Family Connect @@ -34,7 +38,9 @@
{{ item.firstname }} {{ item.lastname }}
- + - Invite : {{currentInvite.firstname}} {{currentInvite.lastname}} + Invite : {{currentInvite.firstname}} {{currentInvite.lastname}} Let's : - + Chat do Number Games do Science Knowledge @@ -66,5 +72,30 @@ Send Invite + + + + Contacting : {{currentInvite.firstname}} {{currentInvite.lastname}} + + + + + + + + + + + + + Cancel + + + Please wait... + + + + +
diff --git a/src/app/components/family-connect/family-connect.component.ts b/src/app/components/family-connect/family-connect.component.ts index c6151e7..aedc92b 100644 --- a/src/app/components/family-connect/family-connect.component.ts +++ b/src/app/components/family-connect/family-connect.component.ts @@ -10,11 +10,13 @@ import {SocketToolsService} from "../../services/socket-tools.service"; export class FamilyConnectComponent implements OnInit { show_invite:boolean = false; show_connect: boolean = false; +call_active:boolean= false; @ViewChild('select_activity') select_activity; connectStart : number = 0; fromData:string = ''; - + session_image_server: string = ""; + curr_session: string = ""; constructor( public sessionDataProviderService: SessionDataProviderService, private wrenchService: WrenchService, @@ -22,6 +24,9 @@ connectStart : number = 0; ) { this.show_connect= true; this.show_invite = false; + this.session_image_server = this.sessionDataProviderService.session_image_server; + this.curr_session = this.sessionDataProviderService.session; + addEventListener('app-family-invite', (data:any) => { // debugger; console.log("CALL DATA ", data); @@ -33,9 +38,11 @@ connectStart : number = 0; startInviteEvent(){ this.show_invite = true; this.show_connect= false; + //this.call_active=true; setTimeout(()=>{ this.show_invite = false; this.show_connect= true; + //this.call_active = false; }, 10000); } ngOnInit() { @@ -56,6 +63,10 @@ connectStart : number = 0; sendInvite(){ console.log(this.select_activity); this.socketToolsService.familyInvite(this.currentInvite); + this.call_active = true; + setTimeout(()=>{ + this.call_active = false; + }, 10000); } cancelInvite(){ this.connectStart = 0; diff --git a/src/app/services/socket-tools.service.ts b/src/app/services/socket-tools.service.ts index 4ece924..9ac6ddc 100644 --- a/src/app/services/socket-tools.service.ts +++ b/src/app/services/socket-tools.service.ts @@ -41,32 +41,14 @@ export class SocketToolsService { } private monitorConnection(): Observable { console.log("********************* MONITORING-SOCKETS *******"); - this.connectionSubject = new BehaviorSubject(false); - this.socket.on('receive_message', (data) => { - console.log(data); - // debugger; - + // console.log(data); const messageType = data?.message?.type; if (messageType!=undefined || messageType != ''){ console.log("************* MESSAGE RECIEVED **** ", messageType); switch(messageType){ case 'FAMILY_INVITE': - // const event = new CustomEvent('NOTIFICATION_ADD', { - // detail: { - // title: 'Error!', - // message: 'There was a problem creating your account.' - // } - // }); - // const event2 = new CustomEvent('app-family-invite', { - // detail: { - // title: 'Start Invite Call', - // message: data - // } - // }); - // dispatchEvent(event2); - console.log("app-family-invite****"); const event = new CustomEvent("app-family-invite", {detail: { title: 'Start Invite Call', @@ -81,7 +63,6 @@ export class SocketToolsService { const event = new Event("app-taskactivities-refresh"); dispatchEvent(event); } - }); this.socket.on('received_refreshmarket_jobs', (data) => {