fix: sendBtn and trim

This commit is contained in:
Richard Ramos 2020-07-31 17:40:23 -04:00
parent 459de8cd1c
commit 397be0b0c0
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F
2 changed files with 7 additions and 5 deletions

View File

@ -36,8 +36,9 @@ Item {
chatsModel.sendImage(sendImageArea.image); chatsModel.sendImage(sendImageArea.image);
} }
if(txtData.text.trim() > 0){ let msg = chatsModel.plainText(Emoji.deparse(txtData.text)).trim()
chatsModel.sendMessage(txtData.text.trim(), chatColumn.isReply ? SelectedMessage.messageId : "", Utils.isOnlyEmoji(txtData.text) ? Constants.emojiType : Constants.messageType) if(msg.length > 0){
chatsModel.sendMessage(msg, chatColumn.isReply ? SelectedMessage.messageId : "", Utils.isOnlyEmoji(msg) ? Constants.emojiType : Constants.messageType)
txtData.text = ""; txtData.text = "";
} }

View File

@ -39,11 +39,12 @@ Rectangle {
chatsModel.sendImage(sendImageArea.image); chatsModel.sendImage(sendImageArea.image);
} }
if(txtData.text.trim().length > 0){ var msg = chatsModel.plainText(Emoji.deparse(txtData.text).trim()).trim()
var msg = interpretMessage(txtData.text.trim()).trim() if(msg.length > 0){
msg = interpretMessage(msg)
msg = Emoji.deparse(msg) msg = Emoji.deparse(msg)
chatsModel.sendMessage(msg, chatColumn.isReply ? SelectedMessage.messageId : "", Utils.isOnlyEmoji(txtData.text) ? Constants.emojiType : Constants.messageType); chatsModel.sendMessage(msg, chatColumn.isReply ? SelectedMessage.messageId : "", Utils.isOnlyEmoji(msg) ? Constants.emojiType : Constants.messageType);
txtData.text = ""; txtData.text = "";
event.accepted = true event.accepted = true
sendMessageSound.stop() sendMessageSound.stop()