Skip to content

Commit

Permalink
Clean up keychain UI code
Browse files Browse the repository at this point in the history
  • Loading branch information
lonkelle committed Jan 13, 2023
1 parent ddc98fc commit 42bbae1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions AltServer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,14 @@ private extension AppDelegate {
private func setupLoginMenuItem() {
do {
let email = try Keychain.shared.getValue(for: .appleIDEmail)
logInMenuItem.isHidden = false
logInMenuItem.title = "Log out (\(email))"
logInMenuItem.action = #selector(logoutFromAppleID)
} catch {
print("Error getting stored AppleID credentials: \(error)")
logInMenuItem.title = "Save New Apple ID to Keychain..."
logInMenuItem.action = #selector(loginToAppleID)
logInMenuItem.isHidden = true
//logInMenuItem.title = "Save Apple ID to Keychain..."
//logInMenuItem.action = #selector(loginToAppleID)
}
}

Expand Down Expand Up @@ -376,7 +378,9 @@ extension AppDelegate: NSMenuDelegate
func menuWillOpen(_ menu: NSMenu)
{
guard menu == self.appMenu else { return }


setupLoginMenuItem()

// Clear any cached _jitAppListMenuControllers.
self._jitAppListMenuControllers.removeAll()

Expand Down

0 comments on commit 42bbae1

Please sign in to comment.