Skip to content

Commit

Permalink
Bug 1416075 - Only show the What's New page on major upgrades (#3435)
Browse files Browse the repository at this point in the history
  • Loading branch information
st3fan committed Nov 10, 2017
1 parent f9ea5db commit 4d3e3b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,14 @@ class BrowserViewController: UIViewController {
showQueuedAlertIfAvailable()
}

// THe logic for shouldShowWhatsNewTab is as follows: If we do not have the LatestAppVersionProfileKey in
// the profile, that means that this is a fresh install and we do not show the What's New. If we do have
// that value, we compare it to the major version of the running app. If it is different then this is an
// upgrade, downgrades are not possible, so we can show the What's New page.

fileprivate func shouldShowWhatsNewTab() -> Bool {
guard let latestMajorAppVersion = profile.prefs.stringForKey(LatestAppVersionProfileKey)?.components(separatedBy: ".").first else {
return DeviceInfo.hasConnectivity()
return false // Clean install, never show What's New
}

return latestMajorAppVersion != AppInfo.majorAppVersion && DeviceInfo.hasConnectivity()
Expand Down

0 comments on commit 4d3e3b4

Please sign in to comment.