Skip to content

Commit

Permalink
fix: address PR comment by k1rill
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-arshad-dev committed Jul 10, 2024
1 parent 0e4a849 commit d44384b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.openedx.core.data.model

import android.text.TextUtils
import com.google.gson.Gson
import com.google.gson.JsonDeserializationContext
import com.google.gson.JsonDeserializer
Expand Down Expand Up @@ -76,7 +75,7 @@ data class CourseStructureModel(
productInfo = courseModes?.find {
EnrollmentMode.VERIFIED.toString().equals(it.slug, ignoreCase = true)
}?.takeIf {
TextUtils.isEmpty(it.androidSku).not() && TextUtils.isEmpty(it.storeSku).not()
it.androidSku.isNullOrEmpty().not() && it.storeSku.isNullOrEmpty().not()
}?.run {
ProductInfo(courseSku = androidSku!!, storeSku = storeSku!!)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.openedx.core.data.model

import android.text.TextUtils
import com.google.gson.annotations.SerializedName
import org.openedx.core.data.model.room.discovery.EnrolledCourseEntity
import org.openedx.core.data.model.room.discovery.ProgressDb
Expand Down Expand Up @@ -46,7 +45,7 @@ data class EnrolledCourse(
productInfo = courseModes?.find {
EnrollmentMode.VERIFIED.toString().equals(it.slug, ignoreCase = true)
}?.takeIf {
TextUtils.isEmpty(it.androidSku).not() && TextUtils.isEmpty(it.storeSku).not()
it.androidSku.isNullOrEmpty().not() && it.storeSku.isNullOrEmpty().not()
}?.run {
ProductInfo(courseSku = androidSku!!, storeSku = storeSku!!)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.openedx.core.domain.interactor

import android.text.TextUtils
import androidx.fragment.app.FragmentActivity
import com.android.billingclient.api.BillingClient.BillingResponseCode
import com.android.billingclient.api.ProductDetails
Expand Down Expand Up @@ -108,7 +107,7 @@ class IAPInteractor(
val productDetail =
billingProcessor.querySyncDetails(purchase.products.first()).productDetailsList?.firstOrNull()
productDetail?.oneTimePurchaseOfferDetails?.takeIf {
TextUtils.isEmpty(purchase.getCourseSku()).not()
purchase.getCourseSku().isNullOrEmpty().not()
}?.let { oneTimeProductDetails ->
val courseSku = purchase.getCourseSku() ?: return@let
val basketId = addToBasket(courseSku)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ class IAPDialogFragment : DialogFragment() {
}
}

iapState is IAPUIState.ProductData && TextUtils.isEmpty(
iapViewModel.purchaseData.formattedPrice
).not() -> {
iapState is IAPUIState.ProductData &&
iapViewModel.purchaseData.formattedPrice.isNullOrEmpty()
.not() -> {
OpenEdXButton(modifier = Modifier.fillMaxWidth(),
text = stringResource(
id = R.string.iap_upgrade_price,
Expand Down

0 comments on commit d44384b

Please sign in to comment.