struct OnboardingMainView: View { @Environment(RCStoreManager.self) private var rcStoreManager var body: some View { VStack { OnboardingWelcomeView { ... } if coordinator.currentScreen == .paywall { Button { dismiss() } label: { Text(rcStoreManager.hasActiveSubscription ? " " : "Continue without pro features") } .disabled(rcStoreManager.hasActiveSubscription) } Button { if rcStoreManager.hasActiveSubscription { print("Attempting to dismiss onboarding") dismiss() } else { print("Trying to purchase subscription") rcStoreManager.purchaseSelectedPackage() } } label: { Text( rcStoreManager.isPurchasing ? "Purchasing" : rcStoreManager.hasActiveSubscription ? "Close" : "Start Free Trial" ) } } .onAppear { DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) { withAnimation { isShowingNextButton = true isShowingPageIndicatorView = true } } } }