diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 85a12324..b03bc5f6 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1178,6 +1178,12 @@ class ChatController extends State { static const Duration _storeInputTimeout = Duration(milliseconds: 500); void onInputBarChanged(String text) { + if (_inputTextIsEmpty != text.isEmpty) { + setState(() { + _inputTextIsEmpty = text.isEmpty; + }); + } + _storeInputTimeoutTimer?.cancel(); _storeInputTimeoutTimer = Timer(_storeInputTimeout, () async { final prefs = await SharedPreferences.getInstance(); @@ -1216,11 +1222,6 @@ class ChatController extends State { ); } } - if (_inputTextIsEmpty != text.isEmpty) { - setState(() { - _inputTextIsEmpty = text.isEmpty; - }); - } } bool _inputTextIsEmpty = true; diff --git a/lib/pages/chat_list/space_view.dart b/lib/pages/chat_list/space_view.dart index 62af3a98..98095bce 100644 --- a/lib/pages/chat_list/space_view.dart +++ b/lib/pages/chat_list/space_view.dart @@ -50,6 +50,10 @@ class _SpaceViewState extends State { Future loadHierarchy([String? prevBatch]) async { final activeSpaceId = widget.controller.activeSpaceId!; + final client = Matrix.of(context).client; + + final activeSpace = client.getRoomById(activeSpaceId); + await activeSpace?.postLoad(); setState(() { error = null; @@ -57,11 +61,11 @@ class _SpaceViewState extends State { }); try { - final response = await Matrix.of(context).client.getSpaceHierarchy( - activeSpaceId, - maxDepth: 1, - from: prevBatch, - ); + final response = await client.getSpaceHierarchy( + activeSpaceId, + maxDepth: 1, + from: prevBatch, + ); if (prevBatch != null) { response.rooms.insertAll(0, _lastResponse[activeSpaceId]?.rooms ?? []); @@ -139,7 +143,8 @@ class _SpaceViewState extends State { label: L10n.of(context)!.joinRoom, icon: Icons.send_outlined, ), - if (spaceChild != null && (activeSpace?.canSendDefaultStates ?? false)) + if (spaceChild != null && + (activeSpace?.canChangeStateEvent(EventTypes.spaceChild) ?? false)) SheetAction( key: SpaceChildContextAction.removeFromSpace, label: L10n.of(context)!.removeFromSpace, @@ -338,6 +343,8 @@ class _SpaceViewState extends State { slivers: [ ChatListHeader(controller: widget.controller), SliverAppBar( + automaticallyImplyLeading: false, + primary: false, titleSpacing: 0, title: ListTile( leading: BackButton(