Socket layer

This commit is contained in:
CHIEFSOFT\ameye
2024-08-09 21:03:04 -04:00
parent d85e24ab94
commit e192970887
5 changed files with 53 additions and 9 deletions
@@ -7,13 +7,13 @@
<ion-card-content>
<ion-item lines="none" style="background-color: transparent; border-radius: 10px;">
<ion-icon name="megaphone-outline" slot="start" color="danger"></ion-icon>
<ion-label>Faith is waiting...</ion-label>
<ion-label>{{fromData.firstname}} is waiting...</ion-label>
<ion-icon name="chevron-forward-outline" slot="end" color="secondary"></ion-icon>
</ion-item>
</ion-card-content>
</ion-card>
<p></p>
<div *ngIf="connectStart==0;">
<div *ngIf="show_connect==true && connectStart==0;">
<div class="bg_white connect-card" (click)="startfamilyConnect()">
<div class="list">
<!-- code to render a large video block-->
@@ -12,6 +12,7 @@ show_invite:boolean = false;
show_connect: boolean = false;
connectStart : number = 0;
fromData:string = '';
constructor(
public sessionDataProviderService: SessionDataProviderService,
@@ -20,8 +21,22 @@ connectStart : number = 0;
) {
this.show_connect= true;
this.show_invite = false;
addEventListener('app-family-invite', (data:any) => {
// debugger;
console.log("CALL DATA ", data);
this.fromData = data.detail.data.message.from ;
this.startInviteEvent();
});
}
startInviteEvent(){
this.show_invite = true;
this.show_connect= false;
setTimeout(()=>{
this.show_invite = false;
this.show_connect= true;
}, 10000);
}
ngOnInit() {
this.getFamilyList();
}
+33 -4
View File
@@ -46,13 +46,42 @@ export class SocketToolsService {
this.socket.on('receive_message', (data) => {
console.log(data);
debugger;
// debugger;
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',
data
}});
dispatchEvent(event);
break;
}
}
else{
console.log("app-taskactivities-refresh MOBILE APP ****");
const event = new Event("app-taskactivities-refresh");
dispatchEvent(event);
}
console.log("app-taskactivities-refresh MOBILE APP ****");
const event = new Event("app-taskactivities-refresh");
dispatchEvent(event);
});
this.socket.on('received_refreshmarket_jobs', (data) => {
+2 -2
View File
@@ -64,7 +64,7 @@ export class BannersDataService {
console.log("BANNERS RETURN->", this.bannerResult);
this.bannerData = this.bannerResult.result_list;
if (this.bannerResult.home_dash_type != "") {
if (this.bannerResult?.home_dash_type != "") {
// debugger;
this.sessionDataProviderService.home_dash_type =
this.bannerResult.home_dash_type;
@@ -106,7 +106,7 @@ export class BannersDataService {
console.log("BANNERS RETURN->", this.familyBannerResult);
this.familyBannerData = this.familyBannerResult.result_list;
if (this.bannerResult.home_dash_type != "") {
if (this.bannerResult?.home_dash_type != "") {
// debugger;
// this.sessionDataProviderService.home_dash_type =
// this.bannerResult.home_dash_type;
@@ -165,7 +165,7 @@ export class SessionDataProviderService {
// this.profile_pic_url = loginResult.profile_pic_url;
// this.isPedningJob = loginResult.pedningjob;
// this.isOfferJob = loginResult.offerjob;
this.user_state=loginResult.state;
this.user_state=loginResult?.state;
// this.city = loginResult.city;
// this.online_name = loginResult.online_name;
// this.pref_email= loginResult.pref_email;