Skip to content

Commit

Permalink
fixed checkForUpdates checkbox action
Browse files Browse the repository at this point in the history
fixes #45
  • Loading branch information
D0miH committed Jan 20, 2020
1 parent c1385dd commit 10adabc
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions iGlance/iGlance/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,9 @@ class ViewController: NSViewController {
@IBAction func cbCheckForUpdatesOnWake_clicked(_ sender: Any) {
AppDelegate.UserSettings.userWantsCheckForUpdateOnWake = (cbCheckForUpdatesOnWake.state == NSButton.StateValue.on)
if cbCheckForUpdatesOnWake.state == NSButton.StateValue.on {
if !SMLoginItemSetEnabled(NCConstants.launcherApplicationIdentifier as CFString, true) {
_ = AppDelegate.dialogOK(question: "Error", text: "Something went wrong, sorry")
cbCheckForUpdatesOnWake.state = NSButton.StateValue.off
} else {
UserDefaults.standard.set(true, forKey: "userWantsCheckForUpdateOnWake")
}
UserDefaults.standard.set(true, forKey: "userWantsCheckForUpdateOnWake")
} else {
if !SMLoginItemSetEnabled(NCConstants.launcherApplicationIdentifier as CFString, false) {
_ = AppDelegate.dialogOK(question: "Error", text: "Something went wrong, sorry")
} else {
UserDefaults.standard.set(false, forKey: "userWantsCheckForUpdateOnWake")
}
UserDefaults.standard.set(false, forKey: "userWantsCheckForUpdateOnWake")
}
}

Expand Down

0 comments on commit 10adabc

Please sign in to comment.