From a8fa7c71fa8d054e548ba753daddfbd4ecf04bae Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:03:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=90=9C=E7=B4=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=89=93=E5=BC=80=E4=B8=AA=E4=BA=BA=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/page/search/user/SearchUserPage.kt | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/search/user/SearchUserPage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/search/user/SearchUserPage.kt index e2458a8b..7b87d3b4 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/search/user/SearchUserPage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/search/user/SearchUserPage.kt @@ -35,6 +35,7 @@ import com.huanchengfly.tieba.post.arch.pageViewModel import com.huanchengfly.tieba.post.ui.common.theme.compose.ExtendedTheme import com.huanchengfly.tieba.post.ui.common.theme.compose.pullRefreshIndicator import com.huanchengfly.tieba.post.ui.page.LocalNavigator +import com.huanchengfly.tieba.post.ui.page.destinations.UserProfilePageDestination import com.huanchengfly.tieba.post.ui.page.search.SearchUiEvent import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar import com.huanchengfly.tieba.post.ui.widgets.compose.Chip @@ -142,12 +143,18 @@ fun SearchUserPage( ) } } - item(key = "ExactMatch") { - SearchUserItem( - item = exactMatch!!, - onClick = { - } - ) + exactMatch?.let { + item(key = "ExactMatch") { + SearchUserItem( + item = it, + onClick = { + val id = it.id?.toLongOrNull() + if (id != null) { + navigator.navigate(UserProfilePageDestination(id)) + } + } + ) + } } } if (showFuzzyMatchResult) { @@ -168,6 +175,10 @@ fun SearchUserPage( SearchUserItem( item = it, onClick = { + val id = it.id?.toLongOrNull() + if (id != null) { + navigator.navigate(UserProfilePageDestination(id)) + } } ) }