diff --git a/DuckDuckGo/MainViewController.swift b/DuckDuckGo/MainViewController.swift index 9d039ce570..e93722b6b3 100644 --- a/DuckDuckGo/MainViewController.swift +++ b/DuckDuckGo/MainViewController.swift @@ -1234,19 +1234,18 @@ class MainViewController: UIViewController { ]) self.notificationView = contentView - view.layoutSubviews() - viewCoordinator.topSlideContainer.layoutIfNeeded() + view.layoutSubviews() viewCoordinator.showTopSlideContainer() - UIView.animate(withDuration: 0.4) { + UIView.animate(withDuration: 0.3) { self.view.layoutIfNeeded() } } func hideNotification() { - self.view.layoutIfNeeded() + view.layoutIfNeeded() viewCoordinator.hideTopSlideContainer() - UIView.animate(withDuration: 0.4) { + UIView.animate(withDuration: 0.3) { self.view.layoutIfNeeded() } completion: { _ in self.notificationView?.removeFromSuperview() @@ -1271,13 +1270,15 @@ class MainViewController: UIViewController { private var brokenSitePromptEvent: UserBehaviorEvent? @objc func attemptToShowBrokenSitePrompt(_ notification: Notification) { - guard userDidInteractWithBrokenSitePrompt, + guard /*userDidInteractWithBrokenSitePrompt,*/ let event = notification.userInfo?[UserBehaviorEvent.Key.event] as? UserBehaviorEvent, let url = currentTab?.url, !url.isDuckDuckGo, notificationView == nil, !isPad, DefaultTutorialSettings().hasSeenOnboarding else { return } - showBrokenSitePrompt(after: event) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + self.showBrokenSitePrompt(after: event) + } } private func showBrokenSitePrompt(after event: UserBehaviorEvent) { @@ -1874,9 +1875,9 @@ extension MainViewController: OmniBarDelegate { func onRefreshPressed() { hideSuggestionTray() currentTab?.refresh() - hideNotification() if brokenSitePromptViewHostingController != nil, let event = brokenSitePromptEvent?.rawValue { - Pixel.fire(pixel: .siteNotWorkingDismissByRefresh, + hideNotification() + Pixel.fire(pixel: .siteNotWorkingDismissByRefresh, withAdditionalParameters: [UserBehaviorEvent.Parameter.event: event]) } } diff --git a/DuckDuckGo/UserBehaviorMonitor.swift b/DuckDuckGo/UserBehaviorMonitor.swift index 7361d940f2..79be9c0cf2 100644 --- a/DuckDuckGo/UserBehaviorMonitor.swift +++ b/DuckDuckGo/UserBehaviorMonitor.swift @@ -105,11 +105,11 @@ final class UserBehaviorMonitor { func fireEventIfActionOccurredRecently(within interval: Double = 30.0, since timestamp: Date?, eventToFire: UserBehaviorEvent) { if let timestamp = timestamp, date.timeIntervalSince(timestamp) < interval { eventMapping.fire(eventToFire) - if PixelExperimentForBrokenSites.cohort == eventToFire.matchingPixelExperimentVariant { +// if PixelExperimentForBrokenSites.cohort == eventToFire.matchingPixelExperimentVariant { NotificationCenter.default.post(name: .userBehaviorDidMatchExperimentVariant, object: self, userInfo: [UserBehaviorEvent.Key.event: eventToFire]) - } +// } } } }