Merge pull request 'only send message on Enter Up event' (#408) from androMessage into trunk
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #408 Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
commit
6eaf95a33b
|
@ -256,7 +256,6 @@ class _MessageViewState extends State<MessageView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _sendMessageHandler(dynamic messageJson) {
|
void _sendMessageHandler(dynamic messageJson) {
|
||||||
var cache = Provider.of<ContactInfoState>(context, listen: false).messageCache;
|
|
||||||
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
|
var profileOnion = Provider.of<ContactInfoState>(context, listen: false).profileOnion;
|
||||||
var identifier = Provider.of<ContactInfoState>(context, listen: false).identifier;
|
var identifier = Provider.of<ContactInfoState>(context, listen: false).identifier;
|
||||||
var profile = Provider.of<ProfileInfoState>(context, listen: false);
|
var profile = Provider.of<ProfileInfoState>(context, listen: false);
|
||||||
|
@ -393,10 +392,12 @@ class _MessageViewState extends State<MessageView> {
|
||||||
// Send the message if enter is pressed without the shift key...
|
// Send the message if enter is pressed without the shift key...
|
||||||
void handleKeyPress(RawKeyEvent event) {
|
void handleKeyPress(RawKeyEvent event) {
|
||||||
var data = event.data;
|
var data = event.data;
|
||||||
|
if (event is RawKeyUpEvent) {
|
||||||
if ((data.logicalKey == LogicalKeyboardKey.enter && !event.isShiftPressed) || data.logicalKey == LogicalKeyboardKey.numpadEnter && !event.isShiftPressed) {
|
if ((data.logicalKey == LogicalKeyboardKey.enter && !event.isShiftPressed) || data.logicalKey == LogicalKeyboardKey.numpadEnter && !event.isShiftPressed) {
|
||||||
_sendMessage();
|
_sendMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void placeHolder() => {};
|
void placeHolder() => {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue