fix(StatusDisplayItem/Quote): notify adapter separately

Only notifying the adapter once could lead to cases where the quoting
status was merged with or replaced by the quote status. Separately
notifying it seems to trigger the issue less often.
This commit is contained in:
FineFindus 2024-07-07 08:50:57 +02:00
parent ca4a1d461a
commit 9b1e79eba8
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 2 additions and 1 deletions

View File

@ -722,10 +722,11 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
assert (this instanceof StatusListFragment) || (this instanceof NotificationsListFragment);
List<StatusDisplayItem> items=this.buildDisplayItems((T) parent);
displayItems.subList(startIndex, endIndex+1).clear();
adapter.notifyItemRangeRemoved(startIndex, endIndex+1);
boolean isEmpty=displayItems.isEmpty();
displayItems.addAll(startIndex, items);
if(!isEmpty)
adapter.notifyItemRangeChanged(startIndex, items.size());
adapter.notifyItemRangeInserted(startIndex, items.size());
}
}