New Offer Expires : {{item.expire | date}}
diff --git a/src/app/components/offers-received/offers-received.component.ts b/src/app/components/offers-received/offers-received.component.ts
index ab60d0e..fd655ac 100644
--- a/src/app/components/offers-received/offers-received.component.ts
+++ b/src/app/components/offers-received/offers-received.component.ts
@@ -13,6 +13,7 @@ import { BannersDataService } from "../../store/banners-data.service";
export class OffersReceivedComponent implements OnInit {
//@ViewChild('offerData') offerData: [];
offerData: [];
+ offerDataReduced: any;
constructor(
private navctrl: NavController,
private router: Router,
@@ -25,7 +26,8 @@ export class OffersReceivedComponent implements OnInit {
// this.getMyOffersData();
this.session_image_server = this.sessionDataProviderService.session_image_server;
setInterval(()=>{
- this.offerData = this.bannersDataService.offerData;
+ this.reduceOfferData(); // = this.bannersDataService.offerData;
+
this.session_image_server = this.sessionDataProviderService.session_image_server;
}, 15000);
}
@@ -88,7 +90,7 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
role: "cancel",
handler: () => {
// this.getMyOffersData();
- this.offerData = this.bannersDataService.offerData;
+ this.reduceOfferData(); // = this.bannersDataService.offerData;
},
},
{
@@ -96,7 +98,7 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
handler: () => {
this.sendOfferResponse(item, 100);
// this.getMyOffersData();
- this.offerData = this.bannersDataService.offerData;
+ this.reduceOfferData(); // = this.bannersDataService.offerData;
},
},
],
@@ -114,7 +116,7 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
role: "cancel",
handler: () => {
//this.getMyOffersData();
- this.offerData = this.bannersDataService.offerData;
+ this.reduceOfferData(); // = this.bannersDataService.offerData;
},
},
{
@@ -122,7 +124,7 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
handler: () => {
this.sendOfferResponse(item, 333);
//this.getMyOffersData();
- this.offerData = this.bannersDataService.offerData;
+ this.reduceOfferData(); // = this.bannersDataService.offerData;
},
},
],
@@ -130,6 +132,16 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
await alert.present();
}
+ reduceOfferData(){
+ this.offerData = this.bannersDataService.offerData;
+ if( this.offerData.length >1){
+ this.offerDataReduced = this.offerData.slice(0,2);
+ }
+ else{
+ this.offerDataReduced = this.offerData;
+ }
+ }
+
responseData: {
action:number,
member_id: number,
@@ -162,7 +174,8 @@ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){
this.offerRespData = offerRespData;
console.log("offerRespData RETURN->", this.offerRespData);
// this.getMyOffersData();
- this.offerData = this.bannersDataService.offerData;
+ // this.offerData = this.bannersDataService.offerData;
+ this.reduceOfferData();
}
);
}