make getauthmethods acctually useful loll - still needs work

fix double content on 17.0+ in foregroundStylecolor
This commit is contained in:
neon443
2025-06-08 21:03:07 +01:00
parent e440168a28
commit ec10964c4b
2 changed files with 31 additions and 3 deletions

View File

@@ -232,8 +232,35 @@ class SSHHandler: ObservableObject {
} }
func getAuthMethods() { func getAuthMethods() {
var method: CInt var recievedMethod: CInt
method = ssh_userauth_list(session, host.username) recievedMethod = ssh_userauth_list(session, host.username)
let allAuthDescriptions: [String] = [
"none",
"unknown",
"password",
"hostbased",
"publickey",
"interactive",
"gssapi_mic"
]
let allAuthRaws: [UInt32] = [
SSH_AUTH_METHOD_NONE,
SSH_AUTH_METHOD_UNKNOWN,
SSH_AUTH_METHOD_PASSWORD,
SSH_AUTH_METHOD_HOSTBASED,
SSH_AUTH_METHOD_PUBLICKEY,
SSH_AUTH_METHOD_INTERACTIVE,
SSH_AUTH_METHOD_GSSAPI_MIC
]
let allAuths = zip(allAuthDescriptions, allAuthRaws)
for authMethod in allAuths {
if authMethod.1 == recievedMethod {
print(authMethod.0)
}
}
print(recievedMethod)
} }
func openShell() { func openShell() {

View File

@@ -19,8 +19,9 @@ struct foregroundColorStyle: ViewModifier {
if #available(iOS 17.0, *) { if #available(iOS 17.0, *) {
if let color = color { if let color = color {
content.foregroundStyle(color) content.foregroundStyle(color)
} else {
content
} }
content
} else { } else {
content.foregroundColor(color) content.foregroundColor(color)
} }