Quick fix crash

This commit is contained in:
Niels Andriesse 2021-03-09 09:07:52 +11:00
parent a17f3277e4
commit 234f5eb022
2 changed files with 1 additions and 2 deletions

View File

@ -148,7 +148,6 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
Storage.read { transaction in
unreadCount = self.thread.unreadMessageCount(transaction: transaction)
}
// FIXME: This crashes when you have more unread messages than loaded view items (viewItems is initially capped to kConversationInitialMaxRangeSize)
unreadViewItems = unreadCount != 0 ? [ConversationViewItem](viewItems[viewItems.endIndex - Int(unreadCount) ..< viewItems.endIndex]) : []
}

View File

@ -173,7 +173,7 @@ NS_ASSUME_NONNULL_BEGIN
static const int kYapDatabasePageSize = 100;
// Never show more than n messages in conversation view when user arrives.
static const int kConversationInitialMaxRangeSize = 300;
static const int kConversationInitialMaxRangeSize = 25000; // TODO: Does it cause issues to set this so high?
// Never show more than n messages in conversation view at a time.
static const int kYapDatabaseRangeMaxLength = 25000;