From 521c0600a2920c4fc1b49215ee7f0b543e6d14c4 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Thu, 18 Aug 2022 14:25:43 -0700 Subject: [PATCH] Load Messages when Syncing a Group Fixes: #306 --- lib/widgets/messagelist.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/widgets/messagelist.dart b/lib/widgets/messagelist.dart index 449acee5..be24f592 100644 --- a/lib/widgets/messagelist.dart +++ b/lib/widgets/messagelist.dart @@ -32,15 +32,18 @@ class _MessageListState extends State { var initi = Provider.of(outerContext, listen: false).initialScrollIndex; bool isP2P = !Provider.of(context).isGroup; bool isGroupAndSyncing = Provider.of(context).isGroup == true && Provider.of(context).status == "Authenticated"; - bool isGroupAndSynced = Provider.of(context).isGroup && Provider.of(context).status == "Synced"; - bool isGroupAndNotAuthenticated = Provider.of(context).isGroup && Provider.of(context).status != "Authenticated"; + + // Older checks, no longer used, kept for reference. + //bool isGroupAndSynced = Provider.of(context).isGroup && Provider.of(context).status == "Synced"; + //bool isGroupAndNotAuthenticated = Provider.of(context).isGroup && Provider.of(context).status != "Authenticated"; bool showEphemeralWarning = (isP2P && Provider.of(context).savePeerHistory != "SaveHistory"); bool showOfflineWarning = Provider.of(context).isOnline() == false; bool showSyncing = isGroupAndSyncing; bool showMessageWarning = showEphemeralWarning || showOfflineWarning || showSyncing; - // Only load historical messages when the conversation is with a p2p contact OR the conversation is a server and *not* syncing. - bool loadMessages = isP2P || (isGroupAndSynced || isGroupAndNotAuthenticated); + // We used to only load historical messages when the conversation is with a p2p contact OR the conversation is a server and *not* syncing. + // With the message cache in place this is no longer necessary + bool loadMessages = true; return RepaintBoundary( child: Container(