mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
Fix appbar back button in Settings screen (#8674)
This commit is contained in:
parent
47f079891f
commit
be854b3e90
1 changed files with 10 additions and 3 deletions
|
@ -23,7 +23,7 @@ class SettingsScreen private constructor(
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun Content() {
|
override fun Content() {
|
||||||
val navigator = LocalNavigator.currentOrThrow
|
val parentNavigator = LocalNavigator.currentOrThrow
|
||||||
if (!isTabletUi()) {
|
if (!isTabletUi()) {
|
||||||
Navigator(
|
Navigator(
|
||||||
screen = if (toBackup) {
|
screen = if (toBackup) {
|
||||||
|
@ -34,7 +34,14 @@ class SettingsScreen private constructor(
|
||||||
SettingsMainScreen
|
SettingsMainScreen
|
||||||
},
|
},
|
||||||
content = {
|
content = {
|
||||||
CompositionLocalProvider(LocalBackPress provides navigator::pop) {
|
val pop: () -> Unit = {
|
||||||
|
if (it.canPop) {
|
||||||
|
it.pop()
|
||||||
|
} else {
|
||||||
|
parentNavigator.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CompositionLocalProvider(LocalBackPress provides pop) {
|
||||||
ScreenTransition(
|
ScreenTransition(
|
||||||
navigator = it,
|
navigator = it,
|
||||||
transition = { Transition.OneWayFade },
|
transition = { Transition.OneWayFade },
|
||||||
|
@ -54,7 +61,7 @@ class SettingsScreen private constructor(
|
||||||
) {
|
) {
|
||||||
TwoPanelBox(
|
TwoPanelBox(
|
||||||
startContent = {
|
startContent = {
|
||||||
CompositionLocalProvider(LocalBackPress provides navigator::pop) {
|
CompositionLocalProvider(LocalBackPress provides parentNavigator::pop) {
|
||||||
SettingsMainScreen.Content(twoPane = true)
|
SettingsMainScreen.Content(twoPane = true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue