From abb3865e360a55c55cd6bb03002c4f7e7ddfae83 Mon Sep 17 00:00:00 2001 From: Michal Smaga Date: Thu, 6 Jun 2024 14:50:52 +0200 Subject: [PATCH 1/2] Show subscription settings section either when subscription purchase is possible or user is authenticated --- DuckDuckGo/SettingsSubscriptionView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DuckDuckGo/SettingsSubscriptionView.swift b/DuckDuckGo/SettingsSubscriptionView.swift index 73cb67cabb..5151dae70b 100644 --- a/DuckDuckGo/SettingsSubscriptionView.swift +++ b/DuckDuckGo/SettingsSubscriptionView.swift @@ -261,7 +261,7 @@ struct SettingsSubscriptionView: View { } }.onReceive(viewModel.$state) { state in - if state.subscription.enabled && state.subscription.canPurchase { + if state.subscription.enabled && (state.subscription.isSignedIn || state.subscription.canPurchase) { isShowingPrivacyPro = true } } From 644b59439de93b1c7bd8320f61cf3c13fe01506c Mon Sep 17 00:00:00 2001 From: Michal Smaga Date: Thu, 6 Jun 2024 15:46:17 +0200 Subject: [PATCH 2/2] Always update value of isShowingPrivacyPro --- DuckDuckGo/SettingsSubscriptionView.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DuckDuckGo/SettingsSubscriptionView.swift b/DuckDuckGo/SettingsSubscriptionView.swift index 5151dae70b..f278b4fac0 100644 --- a/DuckDuckGo/SettingsSubscriptionView.swift +++ b/DuckDuckGo/SettingsSubscriptionView.swift @@ -261,9 +261,7 @@ struct SettingsSubscriptionView: View { } }.onReceive(viewModel.$state) { state in - if state.subscription.enabled && (state.subscription.isSignedIn || state.subscription.canPurchase) { - isShowingPrivacyPro = true - } + isShowingPrivacyPro = state.subscription.enabled && (state.subscription.isSignedIn || state.subscription.canPurchase) } } }