From dc987babe5fc3a4dc352a5ecfdf6f34c7d997f07 Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Sat, 11 Mar 2023 11:43:16 +0800 Subject: [PATCH] =?UTF-8?q?pref(ExplorePage):=20=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E2=80=9C=E5=85=B3?= =?UTF-8?q?=E6=B3=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tieba/post/ui/page/main/explore/ExplorePage.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/main/explore/ExplorePage.kt b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/main/explore/ExplorePage.kt index ceb3fa25..ea328c3e 100644 --- a/app/src/main/java/com/huanchengfly/tieba/post/ui/page/main/explore/ExplorePage.kt +++ b/app/src/main/java/com/huanchengfly/tieba/post/ui/page/main/explore/ExplorePage.kt @@ -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.Toolbar import com.huanchengfly.tieba.post.ui.widgets.compose.accountNavIconIfCompact +import com.huanchengfly.tieba.post.utils.AccountUtil.LocalAccount import kotlinx.coroutines.launch @OptIn(ExperimentalPagerApi::class) @Composable fun ExplorePage() { + val account = LocalAccount.current val context = LocalContext.current - val pages = listOf Unit)>>( - stringResource(id = R.string.title_concern) to @Composable { + val pages = listOfNotNull Unit)>>( + if (account != null) stringResource(id = R.string.title_concern) to @Composable { ConcernPage() - }, + } else null, stringResource(id = R.string.title_personalized) to @Composable { PersonalizedPage() },