diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/ChannelFeedContentState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/ChannelFeedContentState.kt index fa561cbf6..c49976e69 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/ChannelFeedContentState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/ChannelFeedContentState.kt @@ -105,6 +105,8 @@ class ChannelFeedContentState( } } + fun deleteFromFeed(deletedNotes: Set) {} + fun refreshFromOldState(newItems: Set) { val oldNotesState = _feedContent.value if (oldNotesState is ChannelFeedState.Loaded) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt index 962a1009d..2264d833f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt @@ -104,6 +104,34 @@ class AccountFeedContentStates( drafts.updateFeedWith(newNotes) } + fun deleteNotes(newNotes: Set) { + checkNotInMainThread() + + homeLive.deleteFromFeed(newNotes) + homeNewThreads.deleteFromFeed(newNotes) + homeReplies.deleteFromFeed(newNotes) + + dmKnown.updateFeedWith(newNotes) + dmNew.updateFeedWith(newNotes) + + videoFeed.deleteFromFeed(newNotes) + + discoverMarketplace.deleteFromFeed(newNotes) + discoverFollowSets.deleteFromFeed(newNotes) + discoverReads.deleteFromFeed(newNotes) + discoverDVMs.deleteFromFeed(newNotes) + discoverLive.deleteFromFeed(newNotes) + discoverCommunities.deleteFromFeed(newNotes) + discoverPublicChats.deleteFromFeed(newNotes) + + notifications.deleteFromFeed(newNotes) + notificationSummary.invalidateInsertData(newNotes) + + feedListOptions.deleteFromFeed(newNotes) + + drafts.deleteFromFeed(newNotes) + } + fun destroy() { notifications.destroy() notificationSummary.destroy() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt index 1b853709b..3e7c758de 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt @@ -1193,6 +1193,7 @@ class AccountViewModel( } logTime("AccountViewModel deletedEventBundle Update with ${newNotes.size} new notes") { newNotesPreProcessor.runDeleted(newNotes) + feedStates.deleteNotes(newNotes) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/CardFeedContentState.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/CardFeedContentState.kt index a22766245..175e0bec9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/CardFeedContentState.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/CardFeedContentState.kt @@ -340,6 +340,9 @@ class CardFeedContentState( } } + fun deleteFromFeed(deletedNotes: Set) { + } + private fun refreshFromOldState(newItems: Set) { val oldNotesState = _feedContent.value