Remove some no-longer-needed #available checks.

This commit is contained in:
Brent Simmons
2024-02-27 20:06:57 -08:00
parent 9129cd382c
commit 22f3fb62f8
6 changed files with 37 additions and 77 deletions

View File

@@ -128,11 +128,10 @@ class AccountsNewsBlurWindowController: NSWindowController {
}
// MARK: Autofill
func enableAutofill() {
if #available(macOS 11, *) {
usernameTextField.contentType = .username
passwordTextField.contentType = .password
}
usernameTextField.contentType = .username
passwordTextField.contentType = .password
}
}

View File

@@ -196,11 +196,10 @@ class AccountsReaderAPIWindowController: NSWindowController {
}
// MARK: Autofill
func enableAutofill() {
if #available(macOS 11, *) {
usernameTextField.contentType = .username
passwordTextField.contentType = .password
}
usernameTextField.contentType = .username
passwordTextField.contentType = .password
}
}

View File

@@ -102,45 +102,24 @@ struct AddAccountsView: View {
HStack(spacing: 12) {
Spacer()
if #available(OSX 11.0, *) {
Button(action: {
parent?.dismiss(nil)
}, label: {
Text("Cancel")
.frame(width: 76)
})
.help("Cancel")
.keyboardShortcut(.cancelAction)
} else {
Button(action: {
parent?.dismiss(nil)
}, label: {
Text("Cancel")
.frame(width: 76)
})
.accessibility(label: Text("Add Account"))
}
if #available(OSX 11.0, *) {
Button(action: {
addAccountDelegate?.presentSheetForAccount(selectedAccount)
parent?.dismiss(nil)
}, label: {
Text("Continue")
.frame(width: 76)
})
.help("Add Account")
.keyboardShortcut(.defaultAction)
} else {
Button(action: {
addAccountDelegate?.presentSheetForAccount(selectedAccount)
parent?.dismiss(nil)
}, label: {
Text("Continue")
.frame(width: 76)
})
}
Button(action: {
parent?.dismiss(nil)
}, label: {
Text("Cancel")
.frame(width: 76)
})
.help("Cancel")
.keyboardShortcut(.cancelAction)
Button(action: {
addAccountDelegate?.presentSheetForAccount(selectedAccount)
parent?.dismiss(nil)
}, label: {
Text("Continue")
.frame(width: 76)
})
.help("Add Account")
.keyboardShortcut(.defaultAction)
}
.padding(.top, 12)
.padding(.bottom, 4)