Minor refactoring

This commit is contained in:
Vitor Pamplona
2025-05-14 14:56:08 -04:00
parent 979e02e7fa
commit 0f018140f0
2 changed files with 3 additions and 6 deletions
@@ -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,