fix: 搜索用户无法打开个人主页

This commit is contained in:
HuanCheng65 2024-02-02 17:03:03 +08:00
parent 7bb2e38e7e
commit a8fa7c71fa
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
1 changed files with 17 additions and 6 deletions

View File

@ -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.ExtendedTheme
import com.huanchengfly.tieba.post.ui.common.theme.compose.pullRefreshIndicator 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.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.page.search.SearchUiEvent
import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar import com.huanchengfly.tieba.post.ui.widgets.compose.Avatar
import com.huanchengfly.tieba.post.ui.widgets.compose.Chip import com.huanchengfly.tieba.post.ui.widgets.compose.Chip
@ -142,14 +143,20 @@ fun SearchUserPage(
) )
} }
} }
exactMatch?.let {
item(key = "ExactMatch") { item(key = "ExactMatch") {
SearchUserItem( SearchUserItem(
item = exactMatch!!, item = it,
onClick = { onClick = {
val id = it.id?.toLongOrNull()
if (id != null) {
navigator.navigate(UserProfilePageDestination(id))
}
} }
) )
} }
} }
}
if (showFuzzyMatchResult) { if (showFuzzyMatchResult) {
stickyHeader(key = "FuzzyMatchHeader") { stickyHeader(key = "FuzzyMatchHeader") {
Column( Column(
@ -168,6 +175,10 @@ fun SearchUserPage(
SearchUserItem( SearchUserItem(
item = it, item = it,
onClick = { onClick = {
val id = it.id?.toLongOrNull()
if (id != null) {
navigator.navigate(UserProfilePageDestination(id))
}
} }
) )
} }