Browse Source

Fix premature optimization.

pull/113/head
Abhishek Banthia 3 years ago
parent
commit
0e1848afb2
  1. 22
      Clocker/AppDelegate.swift

22
Clocker/AppDelegate.swift

@ -88,16 +88,20 @@ open class AppDelegate: NSObject, NSApplicationDelegate {
NSApp.setActivationPolicy(.accessory)
}
private lazy var controller: OnboardingController? = {
let onboardingStoryboard = NSStoryboard(name: NSStoryboard.Name("Onboarding"), bundle: nil)
return onboardingStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("onboardingFlow")) as? OnboardingController
}()
private var controller: OnboardingController?
private func showOnboardingFlowIfEligible() {
let shouldLaunchOnboarding = (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil && DataStore.shared().timezones().isEmpty)
|| ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument)
shouldLaunchOnboarding ? controller?.launch() : continueUsually()
let shouldLaunchOnboarding = (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil
&& DataStore.shared().timezones().isEmpty)
|| ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument)
if (shouldLaunchOnboarding) {
let onboardingStoryboard = NSStoryboard(name: NSStoryboard.Name("Onboarding"), bundle: nil)
controller = onboardingStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("onboardingFlow")) as? OnboardingController
controller?.launch()
} else {
continueUsually()
}
}
func continueUsually() {

Loading…
Cancel
Save