From 145562d1e11d2040b4106318cc840945c5542ce1 Mon Sep 17 00:00:00 2001 From: Nathaniel Brown Date: Thu, 1 Jul 2021 11:16:55 -0700 Subject: [PATCH] Need to include call to get adherence records in getSessionsForDay --- .../bridge/kmm/shared/repo/ScheduleTimelineRepo.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bridge-client/src/commonMain/kotlin/org/sagebionetworks/bridge/kmm/shared/repo/ScheduleTimelineRepo.kt b/bridge-client/src/commonMain/kotlin/org/sagebionetworks/bridge/kmm/shared/repo/ScheduleTimelineRepo.kt index 194ac32ac..829b10a8e 100644 --- a/bridge-client/src/commonMain/kotlin/org/sagebionetworks/bridge/kmm/shared/repo/ScheduleTimelineRepo.kt +++ b/bridge-client/src/commonMain/kotlin/org/sagebionetworks/bridge/kmm/shared/repo/ScheduleTimelineRepo.kt @@ -62,8 +62,11 @@ class ScheduleTimelineRepo(internal val adherenceRecordRepo: AdherenceRecordRepo ): Flow>> { 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,