Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

[IB-1891} Load first tab in viewDidAppear

  • Loading branch information
winsmith committed Jul 9, 2019
1 parent 512b228 commit c187b7102041c199ad1a9e3fa4cc4de6e1667967
@@ -575,11 +575,6 @@ class BrowserViewController: UIViewController {

updateTabCountUsingTabManager(tabManager, animated: false)
clipboardBarDisplayHandler?.checkIfShouldDisplayBar()
//Cliqz: Open new tab and show update info page first time after update
#if CLIQZ
self.showCliqzUpdateInfoPageFirstTime()
#endif
//Cliqz: end
}

fileprivate func crashedLastLaunch() -> Bool {
@@ -635,6 +630,11 @@ class BrowserViewController: UIViewController {
}
showQueuedAlertIfAvailable()

//Cliqz: Open new tab and show update info page first time after update
#if CLIQZ
self.showCliqzUpdateInfoPageFirstTime()
#endif
//Cliqz: end
}

// THe logic for shouldShowWhatsNewTab is as follows: If we do not have the LatestAppVersionProfileKey in
@@ -2287,7 +2287,14 @@ extension BrowserViewController: UIAdaptivePresentationControllerDelegate {
}

extension BrowserViewController: IntroViewControllerDelegate {
/// Needs documentation: What does the return value mean?
@discardableResult func presentIntroViewController(_ force: Bool = false, animated: Bool = true) -> Bool {
//Cliqz: This is temporary. We should remove this once we have an Intro.
if let deeplink = self.profile.prefs.stringForKey("AdjustDeeplinkKey"), let url = URL(string: deeplink) {
self.launchFxAFromDeeplinkURL(url)
return true
}

// Cliqz: Don't show onboarding for Cliqz for now
#if CLIQZ
// Setup Default Blocking Settings
@@ -2299,12 +2306,6 @@ extension BrowserViewController: IntroViewControllerDelegate {
#endif
// End Cliqz
//Cliqz: This is temporary. We should remove this once we have an Intro.
if let deeplink = self.profile.prefs.stringForKey("AdjustDeeplinkKey"), let url = URL(string: deeplink) {
self.launchFxAFromDeeplinkURL(url)
return true
}

if force || profile.prefs.intForKey(PrefsKeys.IntroSeen) == nil {
#if PAID
let introViewController = LumenIntroViewController()
@@ -31,14 +31,14 @@ extension BrowserViewController {
}

private func isUpdateInfoPageSeen() -> Bool {
if let _ = LocalDataStore.value(forKey: BrowserViewController.updateSeenKey) {
if let updateSeen = LocalDataStore.integer(forKey: BrowserViewController.updateSeenKey), updateSeen == 1 {
return true
}
return false
}

private func markUpdateInfoPageSeen() {
LocalDataStore.set(value: true, forKey: BrowserViewController.updateSeenKey)
LocalDataStore.set(integer: 1, forKey: BrowserViewController.updateSeenKey)
}

}
@@ -15,10 +15,19 @@ class LocalDataStore {
defaults.set(value, forKey: forKey)
defaults.synchronize()
}

class func set(integer: Int, forKey: String) {
defaults.set(integer, forKey: forKey)
defaults.synchronize()
}

class func value(forKey: String) -> Any? {
return defaults.value(forKey: forKey) as Any?
}

class func integer(forKey: String) -> Int? {
return defaults.integer(forKey: forKey)
}

class func removeObject(forKey: String) {
defaults.removeObject(forKey: forKey)

0 comments on commit c187b71

Please sign in to comment.