Skip to content

Commit

Permalink
#868 | Sachin / Himesh | Always fetch latest hideTotalForProgram in i…
Browse files Browse the repository at this point in the history
…ndividualService.allInWithFilters()
  • Loading branch information
himeshr committed Feb 22, 2023
1 parent 8d8fb23 commit 95354e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/openchs-android/src/service/IndividualService.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class IndividualService extends BaseService {
init() {
this.encounterService = this.getService(EncounterService);
this.entityApprovalStatusService = this.getService(EntityApprovalStatusService);
this.hideTotalForProgram = this.getService(OrganisationConfigService).hasHideTotalForProgram();
this.hideTotalForProgram = this.getService(OrganisationConfigService).hasHideTotalForProgram;
}

search(criteria) {
Expand Down Expand Up @@ -135,7 +135,7 @@ class IndividualService extends BaseService {
}

allInWithFilters = (ignored, queryAdditions, programs = [], encounterTypes = []) => {
if(_.isEmpty(encounterTypes) && (!this.hideTotalForProgram || _.isEmpty(programs))) {
if(_.isEmpty(encounterTypes) && (!this.hideTotalForProgram() || _.isEmpty(programs))) {
return this.allIn(ignored, queryAdditions);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class OrganisationConfigService extends BaseService {
return this.getSettings().maxAddressDisplayInlineCount || 30;
}

hasHideTotalForProgram() {
hasHideTotalForProgram = () => {
return this.getSettings().hideTotalForProgram === undefined || this.getSettings().hideTotalForProgram ;
}
}
Expand Down

0 comments on commit 95354e3

Please sign in to comment.