mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 13:57:47 +00:00
fix: correctly handle default auth mode
This commit is contained in:
@@ -62,17 +62,17 @@ class GitServerConfigActivity : BaseGitActivity() {
|
|||||||
when (newAuthMode) {
|
when (newAuthMode) {
|
||||||
AuthMode.SshKey -> check(binding.authModeSshKey.id)
|
AuthMode.SshKey -> check(binding.authModeSshKey.id)
|
||||||
AuthMode.Password -> check(binding.authModePassword.id)
|
AuthMode.Password -> check(binding.authModePassword.id)
|
||||||
AuthMode.None -> check(View.NO_ID)
|
AuthMode.None -> clearChecked()
|
||||||
}
|
}
|
||||||
addOnButtonCheckedListener { _, checkedId, isChecked ->
|
addOnButtonCheckedListener { _, _, _ ->
|
||||||
if (!isChecked) {
|
if (checkedButtonIds.isEmpty()) {
|
||||||
newAuthMode = AuthMode.None
|
newAuthMode = AuthMode.None
|
||||||
return@addOnButtonCheckedListener
|
} else {
|
||||||
}
|
when (checkedButtonId) {
|
||||||
when (checkedId) {
|
binding.authModeSshKey.id -> newAuthMode = AuthMode.SshKey
|
||||||
binding.authModeSshKey.id -> newAuthMode = AuthMode.SshKey
|
binding.authModePassword.id -> newAuthMode = AuthMode.Password
|
||||||
binding.authModePassword.id -> newAuthMode = AuthMode.Password
|
View.NO_ID -> newAuthMode = AuthMode.None
|
||||||
View.NO_ID -> newAuthMode = AuthMode.None
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ class GitServerConfigActivity : BaseGitActivity() {
|
|||||||
if (isHttps) {
|
if (isHttps) {
|
||||||
authModeSshKey.isVisible = false
|
authModeSshKey.isVisible = false
|
||||||
authModePassword.isVisible = true
|
authModePassword.isVisible = true
|
||||||
if (authModeGroup.checkedButtonId != authModePassword.id) authModeGroup.check(View.NO_ID)
|
if (authModeGroup.checkedButtonId != authModePassword.id) authModeGroup.clearChecked()
|
||||||
} else {
|
} else {
|
||||||
authModeSshKey.isVisible = true
|
authModeSshKey.isVisible = true
|
||||||
authModePassword.isVisible = true
|
authModePassword.isVisible = true
|
||||||
|
Reference in New Issue
Block a user