Hide yubikey for unsupported devices

This commit is contained in:
Mingshen Sun 2023-03-12 16:10:29 -07:00
parent cdaf60da73
commit 3edf8efbc5

View file

@ -10,6 +10,7 @@ import CoreData
import passKit
import SVProgressHUD
import UIKit
import YubiKit
class SettingsTableViewController: UITableViewController, UITabBarControllerDelegate {
@IBOutlet var pgpKeyTableViewCell: UITableViewCell!
@ -184,12 +185,14 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
)
}
if YubiKitDeviceCapabilities.supportsMFIAccessoryKey {
optionMenu.addAction(
UIAlertAction(title: Defaults.isYubiKeyEnabled ? "✓ YubiKey" : "YubiKey", style: .default) { _ in
Defaults.isYubiKeyEnabled.toggle()
self.setPGPKeyTableViewCellDetailText()
}
)
}
if Defaults.pgpKeySource != nil {
optionMenu.addAction(