Skip to content

Commit

Permalink
Fix detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamboushaba committed Oct 9, 2024
1 parent 342fd28 commit 06f0775
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object SubscriptionDetailsMapper {
}

private fun WCMetaData.extractPaymentsSyncDate(): SubscriptionPaymentSyncDate? {
return when(isJson) {
return when (isJson) {
true -> value.stringValue.let {
val jsonObject = JsonParser.parseString(it).asJsonObject
val day = jsonObject["day"].asInt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ class ProductDetailCardBuilder(
}
}

@Suppress("LongMethod")
private fun ProductAggregate.shipping(): ProductProperty? {
return if (!this.product.isVirtual && hasShipping) {
val weightWithUnits = product.getWeightWithUnits(parameters.weightUnit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,8 @@ class ProductDetailViewModel @Inject constructor(
attributeListViewState = attributeListViewState.copy(progressDialogState = ProgressDialogState.Hidden)
}

fun hasCategoryChanges() = storedProductAggregate.value?.product?.hasCategoryChanges(viewState.productDraft) ?: false
fun hasCategoryChanges() = storedProductAggregate.value
?.product?.hasCategoryChanges(viewState.productDraft) ?: false

fun hasTagChanges() = storedProductAggregate.value?.product?.hasTagChanges(viewState.productDraft) ?: false

Expand Down Expand Up @@ -851,7 +852,8 @@ class ProductDetailViewModel @Inject constructor(
)
}

fun hasExternalLinkChanges() = storedProductAggregate.value?.product?.hasExternalLinkChanges(viewState.productDraft) ?: false
fun hasExternalLinkChanges() = storedProductAggregate.value
?.product?.hasExternalLinkChanges(viewState.productDraft) ?: false

/**
* Called when the back= button is clicked in a product sub detail screen
Expand Down Expand Up @@ -1863,7 +1865,8 @@ class ProductDetailViewModel @Inject constructor(
triggerEvent(ProductNavigationTarget.RenameProductAttribute(attributeName))
}

fun hasAttributeChanges() = storedProductAggregate.value?.product?.hasAttributeChanges(viewState.productDraft) ?: false
fun hasAttributeChanges() = storedProductAggregate.value
?.product?.hasAttributeChanges(viewState.productDraft) ?: false

/**
* Used by the add attribute screen to fetch the list of store-wide product attributes
Expand Down

0 comments on commit 06f0775

Please sign in to comment.