From c81912ad3a0212fdd3e1d95cf1216da9c73b5612 Mon Sep 17 00:00:00 2001 From: Veyndan Stuart Date: Thu, 28 Sep 2023 14:22:22 +0200 Subject: [PATCH] Preserve saveable values on config change --- .../kotlin/app/cash/redwood/treehouse/TreehouseAppContent.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/redwood-treehouse-host/src/commonMain/kotlin/app/cash/redwood/treehouse/TreehouseAppContent.kt b/redwood-treehouse-host/src/commonMain/kotlin/app/cash/redwood/treehouse/TreehouseAppContent.kt index baa16a3723..e4a9e89e4f 100644 --- a/redwood-treehouse-host/src/commonMain/kotlin/app/cash/redwood/treehouse/TreehouseAppContent.kt +++ b/redwood-treehouse-host/src/commonMain/kotlin/app/cash/redwood/treehouse/TreehouseAppContent.kt @@ -423,9 +423,7 @@ private class ViewContentCodeBinding( override fun performSave(id: String) { appScope.launch(app.dispatchers.zipline) { val state = treehouseUiOrNull?.snapshotState() ?: return@launch - appScope.launch(app.dispatchers.ui) { - app.stateStore.put(id, state) - } + app.stateStore.put(id, state) } }