Skip to content

Merge 18.6-rc-2 into trunk #11492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
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 @@ -82,6 +82,12 @@ class DashboardBlazeViewModel @AssistedInject constructor(
val products = productsResult.getOrThrow()
val blazeCampaignModel = blazeCampaignResult.getOrThrow()

if (products.isEmpty()) {
// When the products is empty, the card will be hidden by the parent view model
// so we don't need to show any UI
return@combine null
}

when {
blazeCampaignModel == null -> showUiForNoCampaign(products)
else -> showUiForCampaign(blazeCampaignModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ class ObserveBlazeWidgetStatus @Inject constructor(
.withIndex()
.map { (index, productsCount) ->
if (productsCount == 0L && index == 0) {
productListRepository.fetchProductList().getOrNull()?.size != 0
productListRepository
.fetchProductList(
productFilterOptions = mapOf(ProductFilterOption.STATUS to ProductStatus.PUBLISH.value)
).getOrNull()
?.filterNot { it.isSampleProduct }
?.size != 0
} else {
productsCount > 0
}
Expand Down
4 changes: 2 additions & 2 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
versionName=18.6-rc-1
versionCode=548
versionName=18.6-rc-2
versionCode=549
Loading