From 504f5206f9861264b2e3a9cc4a135fee24e806f7 Mon Sep 17 00:00:00 2001 From: Davide Date: Mon, 3 Feb 2025 08:27:56 +0100 Subject: [PATCH] Add verification alert to profile editor Finish up #1135 --- .../Views/Profile/ProfileCoordinator.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Packages/App/Sources/AppUIMain/Views/Profile/ProfileCoordinator.swift b/Packages/App/Sources/AppUIMain/Views/Profile/ProfileCoordinator.swift index 51e4e713..a0998ea4 100644 --- a/Packages/App/Sources/AppUIMain/Views/Profile/ProfileCoordinator.swift +++ b/Packages/App/Sources/AppUIMain/Views/Profile/ProfileCoordinator.swift @@ -138,6 +138,13 @@ private extension ProfileCoordinator { do { try iapManager.verify(savedProfile, extra: profileEditor.extraFeatures) } catch AppError.ineligibleProfile(let requiredFeatures) { + guard !iapManager.isLoadingReceipt else { + errorHandler.handle( + title: Strings.Views.Paywall.Alerts.Verifying.title, + message: Strings.Views.Paywall.Alerts.Verifying.message + ) + return + } paywallReason = .init(requiredFeatures, needsConfirmation: true) return } @@ -149,6 +156,13 @@ private extension ProfileCoordinator { do { try iapManager.verify(profileEditor.activeModules, extra: profileEditor.extraFeatures) } catch AppError.ineligibleProfile(let requiredFeatures) { + guard !iapManager.isLoadingReceipt else { + errorHandler.handle( + title: Strings.Views.Paywall.Alerts.Verifying.title, + message: Strings.Views.Paywall.Alerts.Verifying.message + ) + return + } paywallReason = .init(requiredFeatures) return }