mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fix weird validation bug
This commit is contained in:
parent
e2f223b30a
commit
b8861c0e0f
1 changed files with 5 additions and 3 deletions
|
|
@ -149,9 +149,11 @@ struct SecurityConfig: View {
|
|||
}
|
||||
hasChanges = true
|
||||
}
|
||||
.onChange(of: adminKey) { _ in
|
||||
let tempAdminKey = Data(base64Encoded: adminKey) ?? Data()
|
||||
if tempAdminKey.count == 0 || tempAdminKey.count == 32 {
|
||||
.onChange(of: adminKey) { key in
|
||||
let tempKey = Data(base64Encoded: key) ?? Data()
|
||||
if key.isEmpty {
|
||||
hasValidAdminKey = true
|
||||
} else if tempKey.count == 32 {
|
||||
hasValidAdminKey = true
|
||||
} else {
|
||||
hasValidAdminKey = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue