Skip to content

Commit

Permalink
Fix issue where invalid PagedList objects were passed to Conversation…
Browse files Browse the repository at this point in the history
…Adapter.
  • Loading branch information
alex-signal committed Jun 9, 2020
1 parent a758056 commit e04f76b
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -219,9 +219,11 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,

this.conversationViewModel = ViewModelProviders.of(requireActivity(), new ConversationViewModel.Factory()).get(ConversationViewModel.class);
conversationViewModel.getMessages().observe(this, list -> {
if (getListAdapter() != null) {
if (getListAdapter() != null && !list.getDataSource().isInvalid()) {
Log.i(TAG, "submitList");
getListAdapter().submitList(list);
} else if (list.getDataSource().isInvalid()) {
Log.i(TAG, "submitList skipped an invalid list");
}
});
conversationViewModel.getConversationMetadata().observe(this, data -> deferred.defer(() -> presentConversationMetadata(data)));
Expand Down

0 comments on commit e04f76b

Please sign in to comment.