🐛 Bug fixes on macos

This commit is contained in:
2024-04-27 20:10:15 +08:00
parent 657b497370
commit 34dee3773d
12 changed files with 69 additions and 82 deletions

View File

@@ -27,6 +27,7 @@ class _ChatMessageEditorState extends State<ChatMessageEditor> {
final _textController = TextEditingController();
bool _isSubmitting = false;
int? _prevEditingId;
List<Attachment> _attachments = List.empty(growable: true);
@@ -80,8 +81,9 @@ class _ChatMessageEditorState extends State<ChatMessageEditor> {
}
void syncWidget() {
if (widget.editing != null) {
if (widget.editing != null && _prevEditingId != widget.editing!.id) {
setState(() {
_prevEditingId = widget.editing!.id;
_textController.text = widget.editing!.content;
_attachments = widget.editing!.attachments ?? List.empty(growable: true);
});