add missing Column import and spotless formatting
This commit is contained in:
+10
-4
@@ -228,18 +228,24 @@ class SearchBarViewModel(
|
||||
val filtered = if (follows != null) raw.filter { it.author?.pubkeyHex in follows } else raw
|
||||
|
||||
when (order) {
|
||||
SearchSortOrder.POPULAR ->
|
||||
SearchSortOrder.POPULAR -> {
|
||||
filtered.sortedWith(
|
||||
compareByDescending<com.vitorpamplona.amethyst.model.Note> { it.zapsAmount }
|
||||
.thenByDescending { it.createdAt() ?: 0L },
|
||||
)
|
||||
}
|
||||
|
||||
SearchSortOrder.OLDEST ->
|
||||
SearchSortOrder.OLDEST -> {
|
||||
filtered.sortedBy { it.createdAt() ?: 0L }
|
||||
}
|
||||
|
||||
SearchSortOrder.RELEVANCE, SearchSortOrder.NEWEST -> filtered.sortedWith(DefaultFeedOrder)
|
||||
SearchSortOrder.RELEVANCE, SearchSortOrder.NEWEST -> {
|
||||
filtered.sortedWith(DefaultFeedOrder)
|
||||
}
|
||||
|
||||
else -> filtered.sortedWith(DefaultFeedOrder)
|
||||
else -> {
|
||||
filtered.sortedWith(DefaultFeedOrder)
|
||||
}
|
||||
}
|
||||
}.flowOn(Dispatchers.IO)
|
||||
.stateIn(viewModelScope, WhileSubscribed(5000), emptyList())
|
||||
|
||||
+1
@@ -22,6 +22,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.search
|
||||
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.defaultMinSize
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
|
||||
Reference in New Issue
Block a user