From 9a630a14fb7e63d4451e258a9996a48b76b5324d Mon Sep 17 00:00:00 2001 From: Daniel Bernal Date: Mon, 8 Apr 2024 18:04:49 +0200 Subject: [PATCH] Do not signout user on API failure --- DuckDuckGo/SettingsViewModel.swift | 3 --- .../ViewModel/SubscriptionSettingsViewModel.swift | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/DuckDuckGo/SettingsViewModel.swift b/DuckDuckGo/SettingsViewModel.swift index 2ef9137929..00135bbddf 100644 --- a/DuckDuckGo/SettingsViewModel.swift +++ b/DuckDuckGo/SettingsViewModel.swift @@ -430,9 +430,6 @@ extension SettingsViewModel { // Account is active but there's not a valid subscription / entitlements if await PurchaseManager.hasActiveSubscription() { state.subscription.isSubscriptionPendingActivation = true - } else { - // Sign out in case access token is present but no subscription and there is no active transaction on Apple ID - signOutUser() } } diff --git a/DuckDuckGo/Subscription/ViewModel/SubscriptionSettingsViewModel.swift b/DuckDuckGo/Subscription/ViewModel/SubscriptionSettingsViewModel.swift index d7d3134d2c..b5b5ab21ee 100644 --- a/DuckDuckGo/Subscription/ViewModel/SubscriptionSettingsViewModel.swift +++ b/DuckDuckGo/Subscription/ViewModel/SubscriptionSettingsViewModel.swift @@ -84,11 +84,9 @@ final class SubscriptionSettingsViewModel: ObservableObject { date: subscription.expiresOrRenewsAt, product: subscription.productId, billingPeriod: subscription.billingPeriod) - case .failure: - AccountManager().signOut() - DispatchQueue.main.async { - self.state.shouldDismissView = true - } + default: + return + } } }