diff --git a/src/app/components/family-connect/family-connect.component.ts b/src/app/components/family-connect/family-connect.component.ts
index 2d9eae3..b38b0e4 100644
--- a/src/app/components/family-connect/family-connect.component.ts
+++ b/src/app/components/family-connect/family-connect.component.ts
@@ -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();
}
diff --git a/src/app/services/socket-tools.service.ts b/src/app/services/socket-tools.service.ts
index 947068b..4ece924 100644
--- a/src/app/services/socket-tools.service.ts
+++ b/src/app/services/socket-tools.service.ts
@@ -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) => {
diff --git a/src/app/store/banners-data.service.ts b/src/app/store/banners-data.service.ts
index 728d217..6ce0ef5 100644
--- a/src/app/store/banners-data.service.ts
+++ b/src/app/store/banners-data.service.ts
@@ -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;
diff --git a/src/app/store/session-data-provider.service.ts b/src/app/store/session-data-provider.service.ts
index c69f8b9..ae7d890 100644
--- a/src/app/store/session-data-provider.service.ts
+++ b/src/app/store/session-data-provider.service.ts
@@ -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;