changed condition to wait for next sync in stream in waitforfirstsync to better reflect whether the first sync has come through or not
This commit is contained in:
parent
8913f808e1
commit
6cc07d5c38
2 changed files with 10 additions and 16 deletions
|
|
@ -911,11 +911,12 @@ class ChatListController extends State<ChatList>
|
|||
await client.roomsLoading;
|
||||
await client.accountDataLoading;
|
||||
await client.userDeviceKeysLoading;
|
||||
if (client.prevBatch == null) {
|
||||
// #Pangea
|
||||
// See here for explanation of this change: https://github.com/pangeachat/client/pull/539
|
||||
// if (client.prevBatch == null) {
|
||||
if (client.onSync.value?.nextBatch == null) {
|
||||
// Pangea#
|
||||
await client.onSync.stream.first;
|
||||
// #Pangea
|
||||
pangeaController.startChatWithBotIfNotPresent();
|
||||
//Pangea#
|
||||
|
||||
// Display first login bootstrap if enabled
|
||||
// #Pangea
|
||||
|
|
@ -930,7 +931,7 @@ class ChatListController extends State<ChatList>
|
|||
}
|
||||
|
||||
// #Pangea
|
||||
_lessImportantSyncs(client);
|
||||
await _initPangeaControllers(client);
|
||||
// Pangea#
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
|
|
@ -939,9 +940,10 @@ class ChatListController extends State<ChatList>
|
|||
}
|
||||
|
||||
// #Pangea
|
||||
Future<void> _lessImportantSyncs(Client client) async {
|
||||
Future<void> _initPangeaControllers(Client client) async {
|
||||
if (mounted) {
|
||||
GoogleAnalytics.analyticsUserUpdate(client.userID);
|
||||
pangeaController.startChatWithBotIfNotPresent();
|
||||
await pangeaController.subscriptionController.initialize();
|
||||
await pangeaController.myAnalytics.initialize();
|
||||
pangeaController.afterSyncAndFirstLoginInitialization(context);
|
||||
|
|
|
|||
|
|
@ -187,12 +187,7 @@ class ChatListViewBody extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
// #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#
|
||||
if (client.prevBatch == null)
|
||||
SliverList(
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, i) => Opacity(
|
||||
|
|
@ -250,10 +245,7 @@ class ChatListViewBody extends StatelessWidget {
|
|||
childCount: dummyChatCount,
|
||||
),
|
||||
),
|
||||
// #Pangea
|
||||
// if (client.prevBatch != null)
|
||||
if (rooms.isNotEmpty)
|
||||
// Pangea#
|
||||
if (client.prevBatch != null)
|
||||
SliverList.builder(
|
||||
itemCount: rooms.length,
|
||||
itemBuilder: (BuildContext context, int i) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue