Fix crash when clicking fast on back key on the Developer settings screen.
This commit is contained in:
@@ -186,6 +186,10 @@ class PreferencesFlowNode(
|
||||
override fun navigateToPushHistory() {
|
||||
backstack.push(NavTarget.PushHistory)
|
||||
}
|
||||
|
||||
override fun onDone() {
|
||||
backstack.pop()
|
||||
}
|
||||
}
|
||||
createNode<DeveloperSettingsNode>(buildContext, listOf(developerSettingsCallback))
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ class DeveloperSettingsNode(
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
interface Callback : Plugin {
|
||||
fun navigateToPushHistory()
|
||||
fun onDone()
|
||||
}
|
||||
|
||||
private val callback: Callback = callback()
|
||||
@@ -49,7 +50,7 @@ class DeveloperSettingsNode(
|
||||
modifier = modifier,
|
||||
onOpenShowkase = ::openShowkase,
|
||||
onPushHistoryClick = callback::navigateToPushHistory,
|
||||
onBackClick = ::navigateUp
|
||||
onBackClick = callback::onDone,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user