Merge pull request 'only send message on Enter Up event' (#408) from androMessage into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #408
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
Sarah Jamie Lewis 2022-03-24 23:39:48 +00:00
commit 6eaf95a33b
1 changed files with 4 additions and 3 deletions

View File

@ -256,7 +256,6 @@ class _MessageViewState extends State<MessageView> {
}
void _sendMessageHandler(dynamic messageJson) {
var cache = Provider.of<ContactInfoState>(context, listen: false).messageCache;
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
var identifier = Provider.of<ContactInfoState>(context, listen: false).identifier;
var profile = Provider.of<ProfileInfoState>(context, listen: false);
@ -393,8 +392,10 @@ class _MessageViewState extends State<MessageView> {
// Send the message if enter is pressed without the shift key...
void handleKeyPress(RawKeyEvent event) {
var data = event.data;
if ((data.logicalKey == LogicalKeyboardKey.enter && !event.isShiftPressed) || data.logicalKey == LogicalKeyboardKey.numpadEnter && !event.isShiftPressed) {
_sendMessage();
if (event is RawKeyUpEvent) {
if ((data.logicalKey == LogicalKeyboardKey.enter && !event.isShiftPressed) || data.logicalKey == LogicalKeyboardKey.numpadEnter && !event.isShiftPressed) {
_sendMessage();
}
}
}