Fixing missing some notifications.
This commit is contained in:
@@ -48,7 +48,7 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
|||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
private fun refreshSuspended() {
|
private fun refreshSuspended() {
|
||||||
val notes = localFilter.loadTop()
|
val notes = localFilter.feed()
|
||||||
|
|
||||||
val thisAccount = (localFilter as? NotificationFeedFilter)?.account
|
val thisAccount = (localFilter as? NotificationFeedFilter)?.account
|
||||||
val lastNotesCopy = if (thisAccount == lastAccount) lastNotes else null
|
val lastNotesCopy = if (thisAccount == lastAccount) lastNotes else null
|
||||||
@@ -59,7 +59,12 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
|||||||
if (newCards.isNotEmpty()) {
|
if (newCards.isNotEmpty()) {
|
||||||
lastNotes = notes.toSet()
|
lastNotes = notes.toSet()
|
||||||
lastAccount = (localFilter as? NotificationFeedFilter)?.account
|
lastAccount = (localFilter as? NotificationFeedFilter)?.account
|
||||||
updateFeed((oldNotesState.feed.value + newCards).distinctBy { it.id() }.sortedWith(compareBy({ it.createdAt() }, { it.id() })).reversed())
|
val singleList = (oldNotesState.feed.value + newCards)
|
||||||
|
.distinctBy { it.id() }
|
||||||
|
.sortedWith(compareBy({ it.createdAt() }, { it.id() }))
|
||||||
|
.reversed()
|
||||||
|
.take(1000)
|
||||||
|
updateFeed(singleList)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val cards = convertToCard(notes)
|
val cards = convertToCard(notes)
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ fun NotificationScreen(
|
|||||||
NostrAccountDataSource.resetFilters()
|
NostrAccountDataSource.resetFilters()
|
||||||
NotificationFeedFilter.account = account
|
NotificationFeedFilter.account = account
|
||||||
notifFeedViewModel.clear()
|
notifFeedViewModel.clear()
|
||||||
notifFeedViewModel.refresh()
|
notifFeedViewModel.invalidateData()
|
||||||
}
|
}
|
||||||
|
|
||||||
val lifeCycleOwner = LocalLifecycleOwner.current
|
val lifeCycleOwner = LocalLifecycleOwner.current
|
||||||
|
|||||||
Reference in New Issue
Block a user