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,12 +143,18 @@ fun SearchUserPage(
) )
} }
} }
item(key = "ExactMatch") { exactMatch?.let {
SearchUserItem( item(key = "ExactMatch") {
item = exactMatch!!, SearchUserItem(
onClick = { item = it,
} onClick = {
) val id = it.id?.toLongOrNull()
if (id != null) {
navigator.navigate(UserProfilePageDestination(id))
}
}
)
}
} }
} }
if (showFuzzyMatchResult) { if (showFuzzyMatchResult) {
@ -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))
}
} }
) )
} }