mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
Clear message input on send
This commit is contained in:
@@ -598,6 +598,9 @@ class _MessagesTabState extends State<MessagesTab> {
|
||||
return;
|
||||
}
|
||||
|
||||
_textController.clear();
|
||||
_focusNode.unfocus();
|
||||
|
||||
try {
|
||||
// Check destination type and send accordingly
|
||||
if (_destinationType ==
|
||||
@@ -628,13 +631,18 @@ class _MessagesTabState extends State<MessagesTab> {
|
||||
await _sendToChannel(text, connectionProvider, messagesProvider, 0);
|
||||
}
|
||||
|
||||
_textController.clear();
|
||||
_focusNode.unfocus();
|
||||
_markCurrentDestinationAsRead();
|
||||
|
||||
if (!mounted) return;
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
if (_textController.text.isEmpty) {
|
||||
_textController.text = text;
|
||||
_textController.selection = TextSelection.collapsed(
|
||||
offset: _textController.text.length,
|
||||
);
|
||||
_focusNode.requestFocus();
|
||||
}
|
||||
ToastLogger.error(context, 'Failed to send: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user