diff --git a/lib/pangea/chat_settings/pages/edit_course.dart b/lib/pangea/chat_settings/pages/edit_course.dart index 6da7cad93..751d6425c 100644 --- a/lib/pangea/chat_settings/pages/edit_course.dart +++ b/lib/pangea/chat_settings/pages/edit_course.dart @@ -69,23 +69,21 @@ class EditCourseController extends State { if (title.isNotEmpty && title != _room!.name) { await _room!.setName(title); + } else if (title.isEmpty) { + _titleController.text = _room!.name; } + if (desc.isNotEmpty && desc != _room!.topic) { await _room!.setDescription(desc); + } else if (desc.isEmpty) { + _descController.text = _room!.topic; } + if (_avatar != null) { await _room!.setAvatar(_avatar!); } - _room!.client.onRoomState.stream.first.then((_) { - if (mounted) { - setState(() { - _titleController.text = _room!.name; - _descController.text = _room!.topic; - _avatar = null; - }); - } - }); + if (mounted) setState(() {}); } Future _save() async {