Skip to content

Commit 3edf8ef

Browse files
committed
Hide yubikey for unsupported devices
1 parent cdaf60d commit 3edf8ef

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pass/Controllers/SettingsTableViewController.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import CoreData
1010
import passKit
1111
import SVProgressHUD
1212
import UIKit
13+
import YubiKit
1314

1415
class SettingsTableViewController: UITableViewController, UITabBarControllerDelegate {
1516
@IBOutlet var pgpKeyTableViewCell: UITableViewCell!
@@ -184,12 +185,14 @@ class SettingsTableViewController: UITableViewController, UITabBarControllerDele
184185
)
185186
}
186187

187-
optionMenu.addAction(
188-
UIAlertAction(title: Defaults.isYubiKeyEnabled ? "✓ YubiKey" : "YubiKey", style: .default) { _ in
189-
Defaults.isYubiKeyEnabled.toggle()
190-
self.setPGPKeyTableViewCellDetailText()
191-
}
192-
)
188+
if YubiKitDeviceCapabilities.supportsMFIAccessoryKey {
189+
optionMenu.addAction(
190+
UIAlertAction(title: Defaults.isYubiKeyEnabled ? "✓ YubiKey" : "YubiKey", style: .default) { _ in
191+
Defaults.isYubiKeyEnabled.toggle()
192+
self.setPGPKeyTableViewCellDetailText()
193+
}
194+
)
195+
}
193196

194197
if Defaults.pgpKeySource != nil {
195198
optionMenu.addAction(

0 commit comments

Comments
 (0)