From 8e86c53858656ce62d76f0aa0cc1af46002b72ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Carri=C3=B3n?= Date: Wed, 24 May 2023 15:56:07 -0500 Subject: [PATCH 1/2] Use a hack to prevent privacy banner to be dismissed --- .../Settings/Privacy/PrivacyBannerPresenter.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift index f2188502bd9..03259a9b33a 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift @@ -92,3 +92,15 @@ extension PrivacyBannerPresenter { static let retry = NSLocalizedString("Retry", comment: "Retry title on the notice action button") } } + +extension BottomSheetViewController { + /// Temporary hack to prevent the `PrivacyBannerViewController` to be dismissed. + /// This should be changed once https://github.com/wordpress-mobile/WordPressUI-iOS/pull/126 is merged. + /// + public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) { + if children.first is PrivacyBannerViewController { + return + } + super.dismiss(animated: flag, completion: completion) + } +} From 1b5ea3da08d2fac9b48a50a958664a41c14451b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Carri=C3=B3n?= Date: Wed, 24 May 2023 18:53:24 -0500 Subject: [PATCH 2/2] Prevent dismiss on ipad --- .../Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift index 03259a9b33a..d69c06cd876 100644 --- a/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift +++ b/WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift @@ -62,6 +62,7 @@ final class PrivacyBannerPresenter { }) let bottomSheetViewController = BottomSheetViewController(childViewController: privacyBanner) + bottomSheetViewController.isModalInPresentation = true bottomSheetViewController.show(from: viewController) }