Merge pull request 'Load Messages when Syncing a Group' (#527) from load_messages_sync into trunk
continuous-integration/drone/push Build is pending Details

Reviewed-on: #527
This commit is contained in:
Dan Ballard 2022-08-19 02:45:58 +00:00
commit 93284708e0
1 changed files with 7 additions and 4 deletions

View File

@ -32,15 +32,18 @@ class _MessageListState extends State<MessageList> {
var initi = Provider.of<AppState>(outerContext, listen: false).initialScrollIndex;
bool isP2P = !Provider.of<ContactInfoState>(context).isGroup;
bool isGroupAndSyncing = Provider.of<ContactInfoState>(context).isGroup == true && Provider.of<ContactInfoState>(context).status == "Authenticated";
bool isGroupAndSynced = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status == "Synced";
bool isGroupAndNotAuthenticated = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status != "Authenticated";
// Older checks, no longer used, kept for reference.
//bool isGroupAndSynced = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status == "Synced";
//bool isGroupAndNotAuthenticated = Provider.of<ContactInfoState>(context).isGroup && Provider.of<ContactInfoState>(context).status != "Authenticated";
bool showEphemeralWarning = (isP2P && Provider.of<ContactInfoState>(context).savePeerHistory != "SaveHistory");
bool showOfflineWarning = Provider.of<ContactInfoState>(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(