feat(ui, core): minor fixes and improvements

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-12-21 14:11:23 +05:30
committed by xsahil03x
parent 56e030f40c
commit 8b6c732844
2 changed files with 68 additions and 53 deletions
@@ -66,10 +66,7 @@ class MessageInputController extends ValueNotifier<Message> {
void _textEditingSyncer() {
final cleanText = value.command == null
? value.text
: value.text?.replaceFirst(
'/${value.command} ',
'',
);
: value.text?.replaceFirst('/${value.command} ', '');
if (cleanText != _textEditingController.text) {
final previousOffset = _textEditingController.value.selection.start;
@@ -207,7 +204,9 @@ class MessageInputController extends ValueNotifier<Message> {
/// Removes the og attachment.
void clearOGAttachment() {
attachments = [...attachments]..remove(_ogAttachment);
if (_ogAttachment != null) {
removeAttachment(_ogAttachment!);
}
_ogAttachment = null;
}