Skip to content

Commit

Permalink
fix toggle button click
Browse files Browse the repository at this point in the history
Earlier when clicking on a particular stage show more buttons, all the stage events were expanding. This commit fixes this.
  • Loading branch information
Siddharth Agarwal committed Feb 20, 2024
1 parent 045690c commit c70b2f4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ class TeiDataRepositoryImpl(
)
} ?: false

val showAllEvents = selectedStage.showAllEvents &&
selectedStage.stageUid == programStage.uid()

eventViewModels.add(
EventViewModel(
EventViewModelType.STAGE,
Expand All @@ -186,7 +189,7 @@ class TeiDataRepositoryImpl(
),
)
checkEventStatus(eventList).take(
if (selectedStage.showAllEvents) eventList.size else maxEventToShow,
if (showAllEvents) eventList.size else maxEventToShow,
).forEachIndexed { index, event ->
val showTopShadow = index == 0
val showBottomShadow = index == eventList.size - 1
Expand Down Expand Up @@ -237,7 +240,7 @@ class TeiDataRepositoryImpl(
groupedByStage = true,
displayDate = null,
nameCategoryOptionCombo = null,
showAllEvents = selectedStage.showAllEvents,
showAllEvents = showAllEvents,
maxEventsToShow = maxEventToShow,
),
)
Expand Down

0 comments on commit c70b2f4

Please sign in to comment.