pref(ExplorePage): 未登录时不显示“关注”

This commit is contained in:
HuanCheng65 2023-03-11 11:43:16 +08:00
parent e18259e232
commit dc987babe5
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
1 changed files with 5 additions and 3 deletions

View File

@ -30,17 +30,19 @@ import com.huanchengfly.tieba.post.ui.widgets.compose.ActionItem
import com.huanchengfly.tieba.post.ui.widgets.compose.PagerTabIndicator import com.huanchengfly.tieba.post.ui.widgets.compose.PagerTabIndicator
import com.huanchengfly.tieba.post.ui.widgets.compose.Toolbar import com.huanchengfly.tieba.post.ui.widgets.compose.Toolbar
import com.huanchengfly.tieba.post.ui.widgets.compose.accountNavIconIfCompact import com.huanchengfly.tieba.post.ui.widgets.compose.accountNavIconIfCompact
import com.huanchengfly.tieba.post.utils.AccountUtil.LocalAccount
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@OptIn(ExperimentalPagerApi::class) @OptIn(ExperimentalPagerApi::class)
@Composable @Composable
fun ExplorePage() { fun ExplorePage() {
val account = LocalAccount.current
val context = LocalContext.current val context = LocalContext.current
val pages = listOf<Pair<String, (@Composable () -> Unit)>>( val pages = listOfNotNull<Pair<String, (@Composable () -> Unit)>>(
stringResource(id = R.string.title_concern) to @Composable { if (account != null) stringResource(id = R.string.title_concern) to @Composable {
ConcernPage() ConcernPage()
}, } else null,
stringResource(id = R.string.title_personalized) to @Composable { stringResource(id = R.string.title_personalized) to @Composable {
PersonalizedPage() PersonalizedPage()
}, },