You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(RevenueCatUI): keep Tabs' state publish behind visibility check (parity with iOS)
Reverts the effect of e830f1e: a hidden Tabs component should not
publish its selected tab id into the state store, matching the
merged iOS reference implementation.
Copy file name to clipboardExpand all lines: ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/tabs/TabsComponentView.kt
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -81,18 +81,19 @@ internal fun TabsComponentView(
81
81
style = style,
82
82
paywallState = state,
83
83
)
84
+
85
+
if (!tabsState.visible) return
86
+
84
87
// State-driven paywalls: publish the selected tab id into the state store so components that react to it via a
85
-
// `state_condition` override recompose. Done before the visibility check so a hidden Tabs still publishes its
86
-
//selected state. Runs on first composition (seed) and whenever the selection changes.
88
+
// `state_condition` override recompose. Gated behind visibility (parity with iOS): a hidden Tabs never
89
+
//publishes. Runs on first composition (seed) and whenever the selection changes.
87
90
val selectedTabId = style.tabs[state.selectedTabIndex.coerceIn(0..style.tabs.lastIndex)].id
0 commit comments