Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Ref #2151: At least one notification must show before we lock showing…
Browse files Browse the repository at this point in the history
… subsequent notifications.
  • Loading branch information
iccub committed Jan 23, 2020
1 parent 8da88e8 commit 9a31443
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Client/Application/ClientPreferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ extension Preferences {
/// Whether the iOS keyboard auto-opens on a NTP or not
static let autoOpenKeyboard = Option<Bool>(key: "newtabpage.auto-open-keyboard", default: false)

/// At least one notification must show before we lock showing subsequent notifications.
static let atleastOneNTPNotificationWasShowed = Option<Bool>(key: "newtabpage.one-notificaiton-showed",
default: false)

/// Whether the callout to use branded image was shown.
static let brandedImageShowed = Option<Bool>(key: "newtabpage.branded-image-callout-showed",
default: false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ class FavoritesViewController: UIViewController, Themeable {
$0.removeObserver(self, name: .privacyModeChanged, object: nil)
}

// Navigating away from NTP counts the current notification as showed.
Preferences.NewTabPage.brandedImageShowed.value = true

if Preferences.NewTabPage.atleastOneNTPNotificationWasShowed.value {
// Navigating away from NTP counts the current notification as showed.
Preferences.NewTabPage.brandedImageShowed.value = true
}
}

override func viewDidLoad() {
Expand Down Expand Up @@ -297,6 +300,7 @@ class FavoritesViewController: UIViewController, Themeable {
}

vc = notificationVC
Preferences.NewTabPage.atleastOneNTPNotificationWasShowed.value = true
case .claimRewards:
if !Preferences.NewTabPage.attemptToShowClaimRewardsNotification.value { return }

Expand Down

0 comments on commit 9a31443

Please sign in to comment.