Skip to content

Commit

Permalink
Fix 设置页切换 tab 后需要按多次返回才能返回 #927
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Oct 19, 2024
1 parent b581f19 commit c9f061e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ import me.him188.ani.app.ui.settings.tabs.media.source.MediaSourceSubscriptionGr
import me.him188.ani.app.ui.settings.tabs.network.DanmakuGroup
import me.him188.ani.app.ui.settings.tabs.network.GlobalProxyGroup
import me.him188.ani.utils.platform.hasScrollingBug
import me.him188.ani.utils.platform.isMobile

/**
* @see renderPreferenceTab 查看名称
Expand Down Expand Up @@ -227,8 +228,11 @@ internal fun SettingsPageLayout(
}
}

val topAppBarScrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior()

val topAppBarScrollBehavior = if (LocalPlatform.current.isMobile()) {
TopAppBarDefaults.exitUntilCollapsedScrollBehavior()
} else {
null
}

AniListDetailPaneScaffold(
navigator,
Expand All @@ -251,7 +255,7 @@ internal fun SettingsPageLayout(
.consumeWindowInsets(windowInsets.only(WindowInsetsSides.Top))
.fillMaxWidth()
.ifThen(!LocalPlatform.current.hasScrollingBug()) {
nestedScroll(topAppBarScrollBehavior.nestedScrollConnection)
topAppBarScrollBehavior?.let { nestedScroll(it.nestedScrollConnection) }
}
.verticalScroll(rememberScrollState()),
drawerContainerColor = Color.Unspecified,
Expand Down

0 comments on commit c9f061e

Please sign in to comment.