mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fix username on mqtt config save
Set mqtt.address character limit to 62
This commit is contained in:
parent
0a0f7f01cb
commit
93ffd8c72d
6 changed files with 133 additions and 32 deletions
|
|
@ -79,8 +79,8 @@ struct MQTTConfig: View {
|
|||
.onChange(of: address, perform: { _ in
|
||||
let totalBytes = address.utf8.count
|
||||
// Only mess with the value if it is too big
|
||||
if totalBytes > 30 {
|
||||
let firstNBytes = Data(username.utf8.prefix(30))
|
||||
if totalBytes > 62 {
|
||||
let firstNBytes = Data(username.utf8.prefix(62))
|
||||
if let maxBytesString = String(data: firstNBytes, encoding: String.Encoding.utf8) {
|
||||
// Set the shortName back to the last place where it was the right size
|
||||
address = maxBytesString
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue