banner refresh
This commit is contained in:
@@ -121,6 +121,9 @@ export class FamiliyDashComponent implements OnInit {
|
||||
case "acc-family/activities":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
case "acc-family/activities?tab=waiting":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
}
|
||||
if (pageToNavigate != "") {
|
||||
this.router.navigate([pageToNavigate], { state: item });
|
||||
|
||||
@@ -60,6 +60,9 @@ export class JobownerDashComponent implements OnInit {
|
||||
case "acc-family/activities":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
case "acc-family/activities?tab=waiting":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
|
||||
}
|
||||
if(pageToNavigate !=''){
|
||||
|
||||
@@ -30,6 +30,12 @@ export class OffersReceivedComponent implements OnInit {
|
||||
public bannersDataService: BannersDataService
|
||||
) {
|
||||
|
||||
|
||||
addEventListener('app-banner-ready', (data:any) => {
|
||||
console.log("BANNER DATA ", data);
|
||||
this.reduceOfferData();
|
||||
});
|
||||
|
||||
this.session_image_server = this.sessionDataProviderService.session_image_server;
|
||||
setInterval(()=>{
|
||||
this.reduceOfferData(); // = this.bannersDataService.offerData;
|
||||
@@ -140,7 +146,7 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
|
||||
|
||||
reduceOfferData(){
|
||||
this.offerData = this.bannersDataService.offerData;
|
||||
if( this.offerData.length >1 && this.noLimit == false){
|
||||
if( this.offerData?.length >1 && this.noLimit == false){
|
||||
this.offerDataReduced = this.offerData.slice(0,2);
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -148,6 +148,10 @@ export class WorkersDashComponent implements OnInit {
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
|
||||
case "acc-family/activities?tab=waiting":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
|
||||
}
|
||||
if(pageToNavigate !=''){
|
||||
this.router.navigate([pageToNavigate],{state: item});
|
||||
|
||||
@@ -54,6 +54,12 @@ export class HomePage implements OnInit {
|
||||
this.active_job_count = this.sessionDataProviderService.active_job_count;
|
||||
this.enableTracking = this.sessionDataProviderService.tracking;
|
||||
this.etag = "" + Date.now();
|
||||
|
||||
addEventListener('app-banner-ready', (data:any) => {
|
||||
console.log("BANNER DATA ", data);
|
||||
this.refreshBannersData();
|
||||
});
|
||||
|
||||
addEventListener("dash_tool_myjobs", () => {
|
||||
this.myJobs(1);
|
||||
});
|
||||
@@ -257,6 +263,9 @@ export class HomePage implements OnInit {
|
||||
case "acc-family/activities":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
case "acc-family/activities?tab=waiting":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
}
|
||||
if (pageToNavigate != "") {
|
||||
this.router.navigate([pageToNavigate], { state: item });
|
||||
|
||||
@@ -135,10 +135,10 @@ getBlogData(){
|
||||
this.isDisabled=true;
|
||||
|
||||
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false || this.password == null || this.password == '') {
|
||||
this.showAlert('Invalid Login', 'Enter username(email) and password to login');
|
||||
await this.showAlert('Invalid Login', 'Enter username(email) and password to login');
|
||||
return;
|
||||
}
|
||||
loading.present();
|
||||
await loading.present();
|
||||
this.loginData = { username: this.username, password: this.password, sessionid: 'DUMMY-APP-SESSION' }
|
||||
this.wrenchService.loginUser(this.loginData).subscribe(
|
||||
loginResult => {
|
||||
@@ -181,6 +181,7 @@ getBlogData(){
|
||||
}
|
||||
|
||||
async startUpCalls(){
|
||||
await this.bannersDataService.clearCurrentBanners();
|
||||
await this.bannersDataService.getBannersData();
|
||||
await this.joinLoginSockets();
|
||||
await this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
@@ -236,7 +237,7 @@ getBlogData(){
|
||||
}
|
||||
else{
|
||||
this. onReturnToLogin();
|
||||
this.showAlert("Sign up error","Unable to complete the sign up, please try again");
|
||||
this.showAlert("Sign up error","Unable to complete the sign up, please try again");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ export class BannersDataService {
|
||||
offset: 0;
|
||||
};
|
||||
|
||||
async clearCurrentBanners(){
|
||||
this.bannerResult = []; // we need empty
|
||||
}
|
||||
async getBannersData(){
|
||||
if (this.sessionDataProviderService.account_type=='FAMILY'){
|
||||
await this.getFamilyBannersData();
|
||||
@@ -67,11 +70,16 @@ export class BannersDataService {
|
||||
this.bannerData = this.bannerResult.result_list;
|
||||
this.offerData = this.bannerResult.offers_list;
|
||||
if (this.bannerResult?.home_dash_type != "") {
|
||||
// debugger;
|
||||
this.sessionDataProviderService.home_dash_type =
|
||||
this.bannerResult.home_dash_type;
|
||||
this.sessionDataProviderService.home_dash_type = this.bannerResult.home_dash_type;
|
||||
// YOU NEED EVENT FOR EVERYBODY TO REFRESH IF SUBSCRIBED
|
||||
|
||||
}
|
||||
this.homebannerCount = this.bannerData?.length;
|
||||
// YOU NEED EVENT FOR EVERYBODY TO REFRESH IF SUBSCRIBED
|
||||
const event = new CustomEvent("app-banner-ready", {detail: {
|
||||
banners: this.bannerData,
|
||||
offers: this.offerData
|
||||
}});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user