From 1df5a72c529ec55825aa4c36aa6b0fe055a0f06e Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Tue, 22 Oct 2019 19:17:17 -0400 Subject: [PATCH] Fix #1774: Don't allow ads to appear while the user is in overlay mode --- Client/Frontend/Browser/BrowserViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Client/Frontend/Browser/BrowserViewController.swift b/Client/Frontend/Browser/BrowserViewController.swift index 0aec1c807..7ec748b6b 100644 --- a/Client/Frontend/Browser/BrowserViewController.swift +++ b/Client/Frontend/Browser/BrowserViewController.swift @@ -228,8 +228,10 @@ class BrowserViewController: UIViewController { if let rewards = rewards { notificationsHandler = AdsNotificationHandler(ads: rewards.ads, presentingController: self) - notificationsHandler?.canShowNotifications = { - return !PrivateBrowsingManager.shared.isPrivateBrowsing + notificationsHandler?.canShowNotifications = { [weak self] in + guard let self = self else { return false } + return !PrivateBrowsingManager.shared.isPrivateBrowsing && + !self.topToolbar.inOverlayMode } notificationsHandler?.actionOccured = { [weak self] notification, action in guard let self = self else { return }