Removing the check to see if the feed is different before sending it to the UI.

This commit is contained in:
Vitor Pamplona 2023-02-22 18:09:03 -05:00
parent 61920ed31a
commit dbd2f308c2
3 changed files with 4 additions and 8 deletions

View File

@ -63,9 +63,9 @@ abstract class FeedViewModel(val localFilter: FeedFilter<Note>): ViewModel() {
val oldNotesState = feedContent.value
if (oldNotesState is FeedState.Loaded) {
// Using size as a proxy for has changed.
if (notes != oldNotesState.feed.value) {
//if (notes != oldNotesState.feed.value) {
updateFeed(notes)
}
//}
} else {
updateFeed(notes)
}

View File

@ -38,9 +38,7 @@ open class LnZapFeedViewModel(val dataSource: FeedFilter<Pair<Note, Note>>): Vie
val oldNotesState = feedContent.value
if (oldNotesState is LnZapFeedState.Loaded) {
// Using size as a proxy for has changed.
if (notes.size != oldNotesState.feed.value.size || notes.firstOrNull() != oldNotesState.feed.value.firstOrNull()) {
updateFeed(notes)
}
updateFeed(notes)
} else {
updateFeed(notes)
}

View File

@ -42,9 +42,7 @@ open class UserFeedViewModel(val dataSource: FeedFilter<User>): ViewModel() {
val oldNotesState = feedContent.value
if (oldNotesState is UserFeedState.Loaded) {
// Using size as a proxy for has changed.
if (notes.size != oldNotesState.feed.value.size || notes.firstOrNull() != oldNotesState.feed.value.firstOrNull()) {
updateFeed(notes)
}
updateFeed(notes)
} else {
updateFeed(notes)
}