mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-30 12:36:00 +02:00
Avoids changing the showhidden value all the time, triggering recompositions.
This commit is contained in:
parent
861ad218c8
commit
6725114b48
@ -27,8 +27,10 @@ import kotlinx.collections.immutable.ImmutableList
|
||||
sealed class FeedState {
|
||||
object Loading : FeedState()
|
||||
|
||||
class Loaded(val feed: MutableState<ImmutableList<Note>>, val showHidden: MutableState<Boolean>) :
|
||||
FeedState()
|
||||
class Loaded(
|
||||
val feed: MutableState<ImmutableList<Note>>,
|
||||
val showHidden: MutableState<Boolean>,
|
||||
) : FeedState()
|
||||
|
||||
object Empty : FeedState()
|
||||
|
||||
|
@ -328,7 +328,9 @@ abstract class FeedViewModel(val localFilter: FeedFilter<Note>) :
|
||||
_feedContent.update { FeedState.Empty }
|
||||
} else if (currentState is FeedState.Loaded) {
|
||||
// updates the current list
|
||||
currentState.showHidden.value = localFilter.showHiddenKey()
|
||||
if (currentState.showHidden.value != localFilter.showHiddenKey()) {
|
||||
currentState.showHidden.value = localFilter.showHiddenKey()
|
||||
}
|
||||
currentState.feed.value = notes
|
||||
} else {
|
||||
_feedContent.update {
|
||||
|
Loading…
x
Reference in New Issue
Block a user