Improve Message Draft Clearing Logic

This commit is contained in:
Sarah Jamie Lewis 2023-03-27 15:27:43 -07:00
parent d75420e72f
commit 9d963b3134
2 changed files with 3 additions and 4 deletions

View File

@ -101,8 +101,7 @@ class ContactInfoState extends ChangeNotifier {
keys = Map<String, GlobalKey<MessageRowState>>();
}
String get nickname => this._nickname + (this._messageDraft.isNotEmpty() ? "*" : "");
String get nickname => this._nickname + (this._messageDraft.isEmpty() ? "" : "*");
String get savePeerHistory => this._savePeerHistory;
String? get acnCircuit => this._acnCircuit;

View File

@ -11,8 +11,8 @@ class MessageDraft extends ChangeNotifier {
return MessageDraft();
}
bool isNotEmpty() {
return this._messageText != null || this._quotedReference != null;
bool isEmpty() {
return (this._messageText == null && this._quotedReference == null) || (this._messageText != null && this._messageText!.isEmpty);
}
String? get messageText => _messageText;