Skip to content

Commit

Permalink
Fix Home Register not refreshing after initial sync 🐛 (#3616)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin authored Nov 16, 2024
1 parent 9676866 commit f5e64b8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import com.google.android.fhir.FhirEngine
import com.google.android.fhir.sync.CurrentSyncJobStatus
import com.google.android.fhir.sync.LastSyncJobStatus
import com.google.android.fhir.sync.PeriodicSyncConfiguration
import com.google.android.fhir.sync.PeriodicSyncJobStatus
import com.google.android.fhir.sync.RepeatInterval
Expand Down Expand Up @@ -104,7 +105,11 @@ constructor(
) {
this.onEach {
syncListenerManager.onSyncListeners.forEach { onSyncListener ->
onSyncListener.onSync(it.currentSyncJobStatus)
onSyncListener.onSync(
if (it.lastSyncJobStatus != null) {
CurrentSyncJobStatus.Succeeded((it.lastSyncJobStatus as LastSyncJobStatus).timestamp)
} else it.currentSyncJobStatus,
)
}
}
.catch { throwable -> Timber.e("Encountered an error during periodic sync:", throwable) }
Expand Down

0 comments on commit f5e64b8

Please sign in to comment.