Skip to content

Commit

Permalink
Quick fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsandriesse committed Mar 8, 2021
1 parent a17f327 commit 234f5eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion Session/Conversations/ConversationVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]) : []
}

Expand Down
2 changes: 1 addition & 1 deletion Session/Conversations/ConversationViewModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ + (ConversationUpdate *)diffUpdateWithUpdateItems:(nullable NSArray<Conversation
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;
Expand Down

0 comments on commit 234f5eb

Please sign in to comment.