Improves draft deletes in the feeds
This commit is contained in:
@@ -105,6 +105,8 @@ class ChannelFeedContentState(
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteFromFeed(deletedNotes: Set<Note>) {}
|
||||
|
||||
fun refreshFromOldState(newItems: Set<Note>) {
|
||||
val oldNotesState = _feedContent.value
|
||||
if (oldNotesState is ChannelFeedState.Loaded) {
|
||||
|
||||
+28
@@ -104,6 +104,34 @@ class AccountFeedContentStates(
|
||||
drafts.updateFeedWith(newNotes)
|
||||
}
|
||||
|
||||
fun deleteNotes(newNotes: Set<Note>) {
|
||||
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()
|
||||
|
||||
+1
@@ -1193,6 +1193,7 @@ class AccountViewModel(
|
||||
}
|
||||
logTime("AccountViewModel deletedEventBundle Update with ${newNotes.size} new notes") {
|
||||
newNotesPreProcessor.runDeleted(newNotes)
|
||||
feedStates.deleteNotes(newNotes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -340,6 +340,9 @@ class CardFeedContentState(
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteFromFeed(deletedNotes: Set<Note>) {
|
||||
}
|
||||
|
||||
private fun refreshFromOldState(newItems: Set<Note>) {
|
||||
val oldNotesState = _feedContent.value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user