diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts index 57c32741..53933abd 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts @@ -235,7 +235,8 @@ export class ConfirmAddEitComponent implements OnInit { // this.navCtrl.popToRoot(); // this.cs.openHome(); - this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + //this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.cs.setTotalNumberOfWorklistRequest(true); this.cs.openNotificationPage(); } } diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index 62a7dae3..04dc4aca 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1586,9 +1586,11 @@ export class CommonService { this.totalCounter = parseInt(this.sharedService.getSharedData('total-count', false)); return this.totalCounter ? this.totalCounter : 0; } - setTotalNumberOfWorklistRequest() { - if (this.totalCounter > 0) { + setTotalNumberOfWorklistRequest(isAdd: boolean = false) { + if (this.totalCounter > 0 && !isAdd) { this.totalCounter -= 1; + } else if (this.totalCounter >= 0 && isAdd) { + this.totalCounter++; } this.sharedService.setSharedData(this.totalCounter, 'total-count'); } diff --git a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts index bb4f13d3..07d23505 100644 --- a/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts +++ b/Mohem/src/app/notification/worklist-main-ic/worklist-main-ic.component.ts @@ -482,11 +482,13 @@ export class WorklistMainIcComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index 446da7f1..e51d496f 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -430,11 +430,13 @@ export class WorklistMainMRComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index a07b88b2..51b55d8f 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -460,11 +460,13 @@ export class WorklistMainPoComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index 0d79f9ef..241ed4de 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -451,11 +451,13 @@ export class WorklistMainPRComponent implements OnInit { } else if (previousRequest === this.notificationArray[index].REQUEST_TYPE) { this.checkRequestType(index); } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); this.common.openNotificationPage(); } } diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index 0094a606..aedb0ac0 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -631,15 +631,15 @@ export class WorklistMainComponent implements OnInit { this.common.sharedService.setSharedData(this.arr_hr_req_only[requestIndex], HomeComponent.NOTIFICATION_DATA); this.intializeNotificationDetail(); } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); - + // this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); this.common.openNotificationPage(); } } } } else { - this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); - + //this.common.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + this.common.setTotalNumberOfWorklistRequest(true); this.common.openNotificationPage(); } diff --git a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts index d0e317fb..b4543c61 100644 --- a/Mohem/src/app/profile/confirm-address/confirm-address.component.ts +++ b/Mohem/src/app/profile/confirm-address/confirm-address.component.ts @@ -269,8 +269,9 @@ export class ConfirmAddressComponent implements OnInit { this.cs.presentAlert(msg); // } // this.navCtrl.popToRoot(); - this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); + //this.cs.sharedService.setSharedData(true, HomeComponent.COUNT_CHANGED); // this.cs.openHome(); + this.cs.setTotalNumberOfWorklistRequest(true); this.cs.openNotificationPage(); } }