Skip to content

Commit

Permalink
fix(deps): update slack.circuit to v0.19.1 (#843)
Browse files Browse the repository at this point in the history
* fix(deps): update slack.circuit to v0.19.1

* Adjust saveable back stack with initial screen

* Provide fake navigator with initial screen

---------

Co-authored-by: playground-manager[bot] <126197455+playground-manager[bot]@users.noreply.github.com>
Co-authored-by: Ash Davies <[email protected]>
  • Loading branch information
playground-manager[bot] and ashdavies committed Feb 13, 2024
1 parent ce7ec33 commit 4ea8bf8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ internal fun LauncherPresenter(navigator: Navigator): LauncherScreen.State {
}

@Composable
public fun rememberSaveableBackStack(initialScreenName: String? = null): SaveableBackStack = rememberSaveableBackStack {
when (val initialScreen = initialScreenOrNull(initialScreenName)) {
is Screen -> listOf(LauncherScreen, initialScreen)
else -> listOf(LauncherScreen)
}.forEach(::push)
public fun rememberSaveableBackStack(nextScreenName: String? = null): SaveableBackStack {
return rememberSaveableBackStack(LauncherScreen) {
val nextScreen = screenOrNull(nextScreenName)
if (nextScreen != null) push(nextScreen)
}
}

private fun initialScreenOrNull(name: String? = null): Screen? = name?.let {
private fun screenOrNull(name: String? = null): Screen? = name?.let {
return enumValues<LauncherEntries>()
.firstOrNull { it.name.lowercase() == name.lowercase() }
?.screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlin.test.assertEquals

internal class LauncherPresenterTest {

private val navigator = FakeNavigator()
private val navigator = FakeNavigator(LauncherScreen)

@Test
fun `should navigate to after party screen`() = runTest {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kotlinx-serialization = "1.6.2"
ktor = "2.3.8"
paging-compose = "3.2.0-alpha05-0.2.3"
pinterest-ktlint = "0.50.0"
slack-circuit = "0.19.0"
slack-circuit = "0.19.1"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
Expand Down

0 comments on commit 4ea8bf8

Please sign in to comment.