Merge pull request #103 from meshtastic/hotfix/check_keyboard_bytes_less

Fix byte count on screen
This commit is contained in:
Garth Vander Houwen 2022-06-26 21:07:51 -07:00 committed by GitHub
commit 882b0c3d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -352,10 +352,10 @@ struct UserMessageList: View {
TextEditor(text: $typingMessage)
.onChange(of: typingMessage, perform: { value in
let size = typingMessage.utf8.count
totalBytes = typingMessage.utf8.count
// Only mess with the value if it is too big
if size > maxbytes {
if totalBytes > maxbytes {
let firstNBytes = Data(typingMessage.utf8.prefix(maxbytes))