Skip to content

Commit ecaf868

Browse files
authored
Merge pull request #9815 from woocommerce/issue/9811-prevent-banner-from-dismiss
[Privacy Choices] Prevent banner from being dismissed
2 parents 295d1aa + 1b5ea3d commit ecaf868

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Privacy/PrivacyBannerPresenter.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ final class PrivacyBannerPresenter {
6767
})
6868

6969
let bottomSheetViewController = BottomSheetViewController(childViewController: privacyBanner)
70+
bottomSheetViewController.isModalInPresentation = true
7071
bottomSheetViewController.show(from: viewController)
7172

7273
analytics.track(event: .PrivacyChoicesBanner.bannerPresented())
@@ -99,3 +100,15 @@ extension PrivacyBannerPresenter {
99100
static let retry = NSLocalizedString("Retry", comment: "Retry title on the notice action button")
100101
}
101102
}
103+
104+
extension BottomSheetViewController {
105+
/// Temporary hack to prevent the `PrivacyBannerViewController` to be dismissed.
106+
/// This should be changed once https://github.com/wordpress-mobile/WordPressUI-iOS/pull/126 is merged.
107+
///
108+
public override func dismiss(animated flag: Bool, completion: (() -> Void)? = nil) {
109+
if children.first is PrivacyBannerViewController {
110+
return
111+
}
112+
super.dismiss(animated: flag, completion: completion)
113+
}
114+
}

0 commit comments

Comments
 (0)