From 5ed4fdbb36fc6d2151ac884042a4bde1dfce8c73 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Wed, 10 Apr 2024 17:22:11 +0200 Subject: [PATCH] fix: replace correct filter item --- .../android/fragments/BaseStatusListFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index ea6c5f99e..60f351dbb 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -763,12 +763,14 @@ public abstract class BaseStatusListFragment exten public void onGapClick(GapStatusDisplayItem.Holder item, boolean downwards){} public void onWarningClick(WarningFilteredStatusDisplayItem.Holder warning){ - int startPos = warning.getAbsoluteAdapterPosition(); + WarningFilteredStatusDisplayItem filterItem=findItemOfType(warning.getItemID(), WarningFilteredStatusDisplayItem.class); + int startPos=displayItems.indexOf(filterItem); displayItems.remove(startPos); displayItems.addAll(startPos, warning.filteredItems); adapter.notifyItemRangeInserted(startPos, warning.filteredItems.size() - 1); if (startPos == 0) scrollToTop(); warning.getItem().status.filterRevealed = true; + list.invalidateItemDecorations(); } @Override