mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2024-09-30 00:40:49 +00:00
Fixing missing some notifications.
This commit is contained in:
parent
5a375b94d6
commit
f0ba68e467
@ -48,7 +48,7 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
||||
|
||||
@Synchronized
|
||||
private fun refreshSuspended() {
|
||||
val notes = localFilter.loadTop()
|
||||
val notes = localFilter.feed()
|
||||
|
||||
val thisAccount = (localFilter as? NotificationFeedFilter)?.account
|
||||
val lastNotesCopy = if (thisAccount == lastAccount) lastNotes else null
|
||||
@ -59,7 +59,12 @@ open class CardFeedViewModel(val localFilter: FeedFilter<Note>) : ViewModel() {
|
||||
if (newCards.isNotEmpty()) {
|
||||
lastNotes = notes.toSet()
|
||||
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 {
|
||||
val cards = convertToCard(notes)
|
||||
|
@ -75,7 +75,7 @@ fun NotificationScreen(
|
||||
NostrAccountDataSource.resetFilters()
|
||||
NotificationFeedFilter.account = account
|
||||
notifFeedViewModel.clear()
|
||||
notifFeedViewModel.refresh()
|
||||
notifFeedViewModel.invalidateData()
|
||||
}
|
||||
|
||||
val lifeCycleOwner = LocalLifecycleOwner.current
|
||||
|
Loading…
Reference in New Issue
Block a user