From 347fa01ff8eeb6048e0a26cea88c6f75ed6abf2f Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 30 Jul 2024 14:01:11 -0400 Subject: [PATCH] Chat list is shown when rooms are loaded --- lib/pages/chat_list/chat_list.dart | 3 +++ lib/pages/chat_list/chat_list_body.dart | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 8f5515fc4..e4ac86d36 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -909,6 +909,9 @@ class ChatListController extends State Future _waitForFirstSync() async { final client = Matrix.of(context).client; await client.roomsLoading; + // #Pangea + setState(() {}); + // Pangea# await client.accountDataLoading; await client.userDeviceKeysLoading; if (client.prevBatch == null) { diff --git a/lib/pages/chat_list/chat_list_body.dart b/lib/pages/chat_list/chat_list_body.dart index b9b388da9..11be0e097 100644 --- a/lib/pages/chat_list/chat_list_body.dart +++ b/lib/pages/chat_list/chat_list_body.dart @@ -187,7 +187,12 @@ class ChatListViewBody extends StatelessWidget { ], ), ), - if (client.prevBatch == null) + // #Pangea + // Only show loading screen if room list is empty + // because it is still loading + // if (client.prevBatch == null) + if (rooms.isEmpty && client.prevBatch == null) + // Pangea# SliverList( delegate: SliverChildBuilderDelegate( (context, i) => Opacity( @@ -245,7 +250,10 @@ class ChatListViewBody extends StatelessWidget { childCount: dummyChatCount, ), ), - if (client.prevBatch != null) + // #Pangea + // if (client.prevBatch != null) + if (rooms.isNotEmpty) + // Pangea# SliverList.builder( itemCount: rooms.length, itemBuilder: (BuildContext context, int i) {