No need to check for the MainThread in every updateFeedWith

This commit is contained in:
Vitor Pamplona 2024-08-14 15:04:51 -04:00
parent eda5bc50e6
commit 5fbf0462fa
2 changed files with 3 additions and 2 deletions

View File

@ -183,8 +183,6 @@ class FeedContentState(
}
fun updateFeedWith(newNotes: Set<Note>) {
checkNotInMainThread()
if (
localFilter is AdditiveFeedFilter &&
(_feedContent.value is FeedState.Loaded || _feedContent.value is FeedState.Empty)

View File

@ -22,6 +22,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn
import androidx.lifecycle.viewModelScope
import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.service.checkNotInMainThread
import com.vitorpamplona.amethyst.ui.dal.ChatroomListKnownFeedFilter
import com.vitorpamplona.amethyst.ui.dal.ChatroomListNewFeedFilter
import com.vitorpamplona.amethyst.ui.dal.DiscoverChatFeedFilter
@ -66,6 +67,8 @@ class AccountFeedContentStates(
}
fun updateFeedsWith(newNotes: Set<Note>) {
checkNotInMainThread()
homeNewThreads.updateFeedWith(newNotes)
homeReplies.updateFeedWith(newNotes)