Minor refactoring
This commit is contained in:
@@ -110,11 +110,7 @@ class FeedContentState(
|
||||
val oldNotesState = _feedContent.value
|
||||
if (localFilter is AdditiveFeedFilter && lastFeedKey == localFilter.feedKey()) {
|
||||
if (oldNotesState is FeedState.Loaded) {
|
||||
val deletionEvents: List<DeletionEvent> =
|
||||
newItems.mapNotNull {
|
||||
val noteEvent = it.event
|
||||
if (noteEvent is DeletionEvent) noteEvent else null
|
||||
}
|
||||
val deletionEvents: List<DeletionEvent> = newItems.mapNotNull { it.event as? DeletionEvent }
|
||||
|
||||
val oldList =
|
||||
if (deletionEvents.isEmpty()) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
package com.vitorpamplona.amethyst.ui.feeds
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.runtime.Stable
|
||||
import com.vitorpamplona.amethyst.model.Note
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
@@ -40,7 +41,7 @@ sealed class FeedState {
|
||||
) : FeedState()
|
||||
}
|
||||
|
||||
@Stable
|
||||
@Immutable
|
||||
class LoadedFeedState<T>(
|
||||
val list: ImmutableList<T>,
|
||||
val showHidden: Boolean,
|
||||
|
||||
Reference in New Issue
Block a user