Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Need to include call to get adherence records in getSessionsForDay
Browse files Browse the repository at this point in the history
  • Loading branch information
nategbrown9 committed Jul 1, 2021
1 parent ad48477 commit 145562d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ class ScheduleTimelineRepo(internal val adherenceRecordRepo: AdherenceRecordRepo
): Flow<ResourceResult<List<ScheduledSessionWindow>>> {
return combine(
getTimeline(studyId),
activityEventsRepo.getActivityEvents(studyId)
) { timeLineResource, eventsResource ->
activityEventsRepo.getActivityEvents(studyId),
//Need to include call to get AdherenceRecords as part of the combine.
//This will trigger the flow to emit a new value anytime the AdherenceRecords change.
adherenceRecordRepo.getAllCachedAdherenceRecords(studyId)
) { timeLineResource, eventsResource, adherenceRecords ->
extractSessionsForDay(
timeLineResource,
eventsResource,
Expand Down

0 comments on commit 145562d

Please sign in to comment.