Skip to content
Merged

2.7.6 #378

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 @@ -448,7 +448,12 @@ class SuperwallPaywallActivity : AppCompatActivity() {
initBottomSheetBehavior(isModal, height)
val container =
activityView.findViewById<FrameLayout>(com.superwall.sdk.R.id.container)
activityView.setOnClickListener { finish() }
activityView.setOnClickListener {
paywallView()?.dismiss(
result = PaywallResult.Declined(),
closeReason = PaywallCloseReason.ManualClose,
) ?: finish()
}
container.addView(paywallView)
container.requestLayout()
val radius =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.superwall.sdk.store.testmode.TestModeManager
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.awaitAll
import java.util.Date
import java.util.concurrent.ConcurrentHashMap

class StoreManager(
val purchaseController: InternalPurchaseController,
Expand All @@ -35,7 +36,7 @@ class StoreManager(
StoreKit {
val receiptManager by lazy(receiptManagerFactory)

private var productsByFullId: MutableMap<String, ProductState> = java.util.concurrent.ConcurrentHashMap()
private var productsByFullId: ConcurrentHashMap<String, ProductState> = ConcurrentHashMap()

private data class ProductProcessingResult(
val fullProductIdsToLoad: Set<String>,
Expand Down Expand Up @@ -148,6 +149,7 @@ class StoreManager(
is ProductState.Loading -> {
if (id !in newDeferreds) loading.add(state.deferred)
}

is ProductState.Error -> {
// Error state already exists — replace atomically for retry
val deferred = CompletableDeferred<StoreProduct>()
Expand Down
Loading