Disable close button when action is in progress#1528
Conversation
| validatedPaywallData = displayablePaywall, | ||
| template = template, | ||
| shouldDisplayDismissButton = options.shouldDisplayDismissButton, | ||
| actionInProgress = actionInProgress.value, |
There was a problem hiding this comment.
I added this here, then realized that we need to update the state in verifyNoActionInProgressOrStartAction(), where actionInProgress is updated. I am not sure there's a more efficient way of doing it. The alternative would be to update the button wherever the PaywallListener is implemented
What do you think @tonidero
There was a problem hiding this comment.
Hmm we're already exposing actionInProgress from the PaywallViewModel as a different State. Couldn't we just use that in the InternalPaywall directly? I believe in that case this wiring won't be necessary? Do lmk if I'm missing something!
There was a problem hiding this comment.
oh that's right, I missed we were exposing that as a state already
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1528 +/- ##
=======================================
Coverage 84.14% 84.14%
=======================================
Files 218 218
Lines 7196 7196
Branches 1007 1007
=======================================
Hits 6055 6055
Misses 750 750
Partials 391 391 ☔ View full report in Codecov by Sentry. |
| ) | ||
| } | ||
| CloseButton(state.shouldDisplayDismissButton, onDismiss) | ||
| CloseButton(state.shouldDisplayDismissButton, viewModel.actionInProgress.value, onDismiss) |
There was a problem hiding this comment.
Maybe add labels to the parameters here and in InternalPaywall?
| IconButton( | ||
| onClick = onClick, | ||
| modifier = Modifier.align(Alignment.TopStart), | ||
| enabled = actionInProgress.not(), |
**This is an automatic release.** ### RevenueCatUI * Paywalls: fix empty description when using custom package type and Offer Period (#1519) via Andy Boedo (@aboedo) ### Bugfixes * Disable close button when action is in progress (#1528) via Cesar de la Vega (@vegaro) ### Dependency Updates * Bump danger from 9.4.1 to 9.4.2 (#1527) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Add revenuecatui docs to reference docs (#1526) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Equivalent of RevenueCat/purchases-ios#3474