From 3b0bf07e5878b045dacf1d65b2183072f4150cf9 Mon Sep 17 00:00:00 2001 From: davotoula Date: Thu, 23 Apr 2026 13:33:51 +0200 Subject: [PATCH] add missing Column import and spotless formatting --- .../screen/loggedIn/search/SearchBarViewModel.kt | 14 ++++++++++---- .../ui/screen/loggedIn/search/SearchScreen.kt | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchBarViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchBarViewModel.kt index 991a84183..bd7e2f5f5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchBarViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchBarViewModel.kt @@ -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 { 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()) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt index decabb57f..e5479e836 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/search/SearchScreen.kt @@ -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