From c1236b3faddb00893647bfc38bafc18be77c2c09 Mon Sep 17 00:00:00 2001 From: Abhishek Banthia <8280282+n0shake@users.noreply.github.com> Date: Wed, 20 Apr 2022 12:55:02 -0400 Subject: [PATCH] Formatting. --- Clocker/AppDelegate.swift | 12 +++++++----- .../Panel/Data Layer/TimezoneDataOperations.swift | 2 +- Clocker/Panel/UI/TimezoneDataSource.swift | 4 ++-- .../Preferences/General/PreferencesDataSource.swift | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Clocker/AppDelegate.swift b/Clocker/AppDelegate.swift index 2f3a1cd..6f265da 100644 --- a/Clocker/AppDelegate.swift +++ b/Clocker/AppDelegate.swift @@ -89,13 +89,15 @@ open class AppDelegate: NSObject, NSApplicationDelegate { } private var controller: OnboardingController? - + private func showOnboardingFlowIfEligible() { - let shouldLaunchOnboarding = (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil - && DataStore.shared().timezones().isEmpty) - || ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument) + let isTestInProgress = ProcessInfo.processInfo.arguments.contains(CLOnboaringTestsLaunchArgument) + let shouldLaunchOnboarding = + (DataStore.shared().retrieve(key: CLShowOnboardingFlow) == nil + && DataStore.shared().timezones().isEmpty) + || isTestInProgress - if (shouldLaunchOnboarding) { + if shouldLaunchOnboarding { let onboardingStoryboard = NSStoryboard(name: NSStoryboard.Name("Onboarding"), bundle: nil) controller = onboardingStoryboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("onboardingFlow")) as? OnboardingController controller?.launch() diff --git a/Clocker/Panel/Data Layer/TimezoneDataOperations.swift b/Clocker/Panel/Data Layer/TimezoneDataOperations.swift index 8d436a8..f62e648 100644 --- a/Clocker/Panel/Data Layer/TimezoneDataOperations.swift +++ b/Clocker/Panel/Data Layer/TimezoneDataOperations.swift @@ -14,7 +14,7 @@ class TimezoneDataOperations: NSObject { private static let currentLocale = Locale.current.identifier init(with timezone: TimezoneData, store: DataStore) { - self.dataObject = timezone + dataObject = timezone self.store = store super.init() } diff --git a/Clocker/Panel/UI/TimezoneDataSource.swift b/Clocker/Panel/UI/TimezoneDataSource.swift index cc248ef..1d74463 100644 --- a/Clocker/Panel/UI/TimezoneDataSource.swift +++ b/Clocker/Panel/UI/TimezoneDataSource.swift @@ -143,7 +143,7 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate { tableView.removeRows(at: indexSet, withAnimation: NSTableView.AnimationOptions()) - if self.dataStore.shouldDisplay(ViewType.showAppInForeground) { + if self.dataStore.shouldDisplay(ViewType.showAppInForeground) { windowController.deleteTimezone(at: row) } else { guard let panelController = PanelController.panel() else { return } @@ -178,7 +178,7 @@ extension TimezoneDataSource: NSTableViewDataSource, NSTableViewDelegate { if response.rawValue == 1000 { OperationQueue.main.addOperation { [weak self] in guard let sSelf = self else { return } - + let indexSet = IndexSet(integer: row) tableView.removeRows(at: indexSet, withAnimation: NSTableView.AnimationOptions.slideUp) diff --git a/Clocker/Preferences/General/PreferencesDataSource.swift b/Clocker/Preferences/General/PreferencesDataSource.swift index eb6672e..aafef6c 100644 --- a/Clocker/Preferences/General/PreferencesDataSource.swift +++ b/Clocker/Preferences/General/PreferencesDataSource.swift @@ -29,7 +29,7 @@ class PreferencesDataSource: NSObject { init(with store: DataStore, callbackDelegate delegate: PreferenceSelectionUpdates) { self.store = store - self.updateDelegate = delegate + updateDelegate = delegate super.init() } }