From e2c011ec60f762b87482f7490771806187cfe8d1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 25 Aug 2023 13:01:49 -0400 Subject: [PATCH] Avoids lists with the same hexId because the app was pruning events while loading them --- .../java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt index fd1d6aafa..d4cb36cf5 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/FeedViewModel.kt @@ -236,7 +236,7 @@ abstract class FeedViewModel(val localFilter: FeedFilter) : ViewModel(), I checkNotInMainThread() lastFeedKey = localFilter.feedKey() - val notes = localFilter.loadTop().toImmutableList() + val notes = localFilter.loadTop().distinctBy { it.idHex }.toImmutableList() val oldNotesState = _feedContent.value if (oldNotesState is FeedState.Loaded) {