Skip to content

Commit

Permalink
Paywalls: simplified LoadingPaywallView (#3265)
Browse files Browse the repository at this point in the history
This is a better fix than #3235. Instead of marking the view as
disabled, which is also used by `PurchaseHandler` to signal that a
purchase is in progress, we simply make that view not accept touches.

Which has the actual effect that we want (not being interactive),
without messing with how it's displayed).

![Screenshot 2023-10-02 at 14 04
49](https://github.com/RevenueCat/purchases-ios/assets/685609/049a1931-8e71-4875-b297-c00562d318e6)
  • Loading branch information
NachoSoto authored Oct 3, 2023
1 parent 80082a4 commit aac02f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RevenueCatUI/Views/LoadingPaywallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct LoadingPaywallView: View {
introEligibility: Self.introEligibility,
purchaseHandler: Self.purchaseHandler
)
.disabled(true)
.allowsHitTesting(false)
.redacted(reason: .placeholder)
}

Expand Down
5 changes: 1 addition & 4 deletions RevenueCatUI/Views/PurchaseButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ private struct PurchaseButtonLabel: View {
@Environment(\.isEnabled)
private var isEnabled

@Environment(\.redactionReasons.isEmpty)
private var isNotRedacted

var body: some View {
IntroEligibilityStateView(
textWithNoIntroOffer: self.package.localization.callToAction,
Expand All @@ -135,7 +132,7 @@ private struct PurchaseButtonLabel: View {
.padding()
.hidden(if: !self.isEnabled)
.overlay {
if !self.isEnabled && self.isNotRedacted {
if !self.isEnabled {
ProgressView()
.progressViewStyle(.circular)
.tint(self.colors.callToActionForegroundColor)
Expand Down

0 comments on commit aac02f5

Please sign in to comment.