Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class WooPosProductsDataSource @Inject constructor(
private var activeSource: WooPosProductsDataSourceInterface? = null

fun prepopulateCache(): Flow<WooPosPrepopulatingDataStatus> = flow {
emit(WooPosPrepopulatingDataStatus.Syncing)

val requirement = syncStatusChecker.checkSyncRequirement()
when (requirement) {
is WooPosFullSyncRequirement.LocalCatalogDisabled -> {
Expand All @@ -80,6 +78,7 @@ class WooPosProductsDataSource @Inject constructor(
}

is WooPosFullSyncRequirement.BlockingRequired -> {
emit(WooPosPrepopulatingDataStatus.Syncing)
activeSource = localDbDataSource
localDbDataSource.prepopulateCache().fold(
onSuccess = {
Expand Down