From 2029c67cae868d12c9e5ac7ffeae924abfd6cf0f Mon Sep 17 00:00:00 2001 From: Dr Watson <> Date: Tue, 3 Jun 2025 12:19:16 +0300 Subject: [PATCH 1/3] open route for result example --- composeApp/src/commonMain/kotlin/DI.kt | 4 ++ .../kotlin/coordinator/AppCoordinator.kt | 11 +++++ composeApp/src/commonMain/kotlin/ui/Route.kt | 2 + .../src/commonMain/kotlin/ui/app/App.kt | 4 ++ .../commonMain/kotlin/ui/home/HomeScreen.kt | 4 ++ .../kotlin/ui/home/HomeViewInteractor.kt | 1 + .../ConfirmationScreen.kt | 46 ++++++++++++++++++ .../ConfirmationViewInteractor.kt | 23 +++++++++ .../OpenForResultExampleScreen.kt | 47 +++++++++++++++++++ .../OpenForResultExampleViewInteractor.kt | 24 ++++++++++ 10 files changed, 166 insertions(+) create mode 100644 composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt create mode 100644 composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt create mode 100644 composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt create mode 100644 composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt diff --git a/composeApp/src/commonMain/kotlin/DI.kt b/composeApp/src/commonMain/kotlin/DI.kt index 60c11fd..06daa51 100644 --- a/composeApp/src/commonMain/kotlin/DI.kt +++ b/composeApp/src/commonMain/kotlin/DI.kt @@ -22,6 +22,8 @@ import ui.device.DeviceHomeViewInteractor import ui.file.FileSystemViewInteractor import ui.home.HomeViewInteractor import ui.iosServices.IOSServicesScreenViewInteractor +import ui.openForResultExample.ConfirmationViewInteractor +import ui.openForResultExample.OpenForResultExampleViewInteractor import ui.popups.PopupsScreenViewInteractor import ui.viewStateExample.ViewStateExampleViewInteractor @@ -59,4 +61,6 @@ fun commonModule() = module { factory { IOSServicesScreenViewInteractor(get()) } factory { CapabilityScreenViewInteractor(get()) } factory { ColorPickerViewInteractor() } + factory { OpenForResultExampleViewInteractor(get()) } + factory { ConfirmationViewInteractor(get()) } } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt b/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt index c3ff0f2..de602cb 100644 --- a/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt +++ b/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt @@ -37,4 +37,15 @@ class AppCoordinator(): Coordinator( fun colorPickerClicked() = push(Route.ColorPicker) fun htmlDemoClicked() = push(Route.WebDemo) fun windowInfoClicked() = push(Route.WindowInfo) + fun openForResultExampleClicked() = push(Route.OpenForResultExample) + suspend fun openForResultExampleConfirmationClicked() = transactionWithResult(Boolean::class) { + push(Route.OpenForResultExampleConfirmation) + } + fun openForResultExampleConfirmationYesClicked() { + pop { withResult(true) } + } + fun openForResultExampleConfirmationNoClicked() { + pop { withResult(false) } + } + } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/ui/Route.kt b/composeApp/src/commonMain/kotlin/ui/Route.kt index 3289ed8..5de81bd 100644 --- a/composeApp/src/commonMain/kotlin/ui/Route.kt +++ b/composeApp/src/commonMain/kotlin/ui/Route.kt @@ -22,6 +22,8 @@ sealed class Route( data object ColorPicker : Route(webRoutePath = "/color-picker") data object WebDemo : Route(webRoutePath = "/web-demo") data object WindowInfo : Route(webRoutePath = "/window-info") + data object OpenForResultExample : Route(webRoutePath = "/open-for-result") + data object OpenForResultExampleConfirmation : Route(webRoutePath = "/open-for-result-confirmation") companion object { val deepLinks = Router.buildDeepLinks { diff --git a/composeApp/src/commonMain/kotlin/ui/app/App.kt b/composeApp/src/commonMain/kotlin/ui/app/App.kt index 924750e..d44e678 100644 --- a/composeApp/src/commonMain/kotlin/ui/app/App.kt +++ b/composeApp/src/commonMain/kotlin/ui/app/App.kt @@ -23,6 +23,8 @@ import ui.markdown.MarkdownScreen import ui.popups.PopupsScreen import ui.viewStateExample.ViewStateExampleScreen import ui.htmlDemo.HtmlDemoScreen +import ui.openForResultExample.ConfirmationScreen +import ui.openForResultExample.OpenForResultExampleScreen import ui.widgets.WidgetsScreen import ui.windowInfo.WindowInfoScreen @@ -62,6 +64,8 @@ fun App( RouteTransitionDirection.Out } ) + is Route.OpenForResultExample -> OpenForResultExampleScreen() + is Route.OpenForResultExampleConfirmation -> ConfirmationScreen() } } } diff --git a/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt b/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt index c5826db..1ea24f5 100644 --- a/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt +++ b/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt @@ -112,6 +112,10 @@ fun HomeScreen( onClick = interactor::htmlDemoButtonClicked, enabled = Platform.current == Platform.WebBrowser, ) + Button( + content = { Text("Open Route For Result Example") }, + onClick = interactor::openForResultExampleClicked, + ) } } } diff --git a/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt b/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt index bf2a554..8db3ca2 100644 --- a/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt +++ b/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt @@ -19,4 +19,5 @@ class HomeViewInteractor( fun colorPickerButtonClicked() = coordinator.colorPickerClicked() fun htmlDemoButtonClicked() = coordinator.htmlDemoClicked() fun windowInfoButtonClicked() = coordinator.windowInfoClicked() + fun openForResultExampleClicked() = coordinator.openForResultExampleClicked() } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt new file mode 100644 index 0000000..0e6d780 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt @@ -0,0 +1,46 @@ +package ui.openForResultExample + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.material.TextField +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.outsidesource.oskitcompose.interactor.collectAsState +import com.outsidesource.oskitcompose.lib.rememberInjectForRoute +import ui.common.Screen + +@Composable +fun ConfirmationScreen( + interactor: ConfirmationViewInteractor = rememberInjectForRoute() +) { + val state = interactor.collectAsState() + + Screen("Example Route with Result") { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Text("Did you just sign in from a new device?") + + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + Button( + content = { Text("Yes, that was me") }, + onClick = interactor::yesClicked + ) + Button( + content = { Text("No, that's not me") }, + onClick = interactor::noClicked + ) + } + } + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt new file mode 100644 index 0000000..c726da9 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt @@ -0,0 +1,23 @@ +package ui.openForResultExample + +import com.outsidesource.oskitkmp.interactor.Interactor +import coordinator.AppCoordinator + +data class ConfirmationViewState( + val result: Boolean? = null, +) + +class ConfirmationViewInteractor( + private val coordinator: AppCoordinator +): Interactor( + initialState = ConfirmationViewState() +) { + + fun yesClicked() { + coordinator.openForResultExampleConfirmationYesClicked() + } + + fun noClicked() { + coordinator.openForResultExampleConfirmationNoClicked() + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt new file mode 100644 index 0000000..93d02fe --- /dev/null +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt @@ -0,0 +1,47 @@ +package ui.openForResultExample + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import com.outsidesource.oskitcompose.interactor.collectAsState +import com.outsidesource.oskitcompose.lib.rememberInjectForRoute +import ui.common.Screen + +@Composable +fun OpenForResultExampleScreen( + interactor: OpenForResultExampleViewInteractor = rememberInjectForRoute() +) { + val state = interactor.collectAsState() + + Screen("Open Route For Result Example") { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Text( + "This example shows how to launch a route and await a result from it.\n" + + "Press the button to open the confirmation screen and receive " + + "the user’s selection as the result.\n", + textAlign = TextAlign.Center + ) + + Button( + content = { Text("Open Confirmation Route") }, + onClick = interactor::openConfirmationRouteClicked + ) + + if (state.result != null) { + Text("Returned result: ${if (state.result) "Yes" else "No"}") + } + + } + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt new file mode 100644 index 0000000..85faef4 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt @@ -0,0 +1,24 @@ +package ui.openForResultExample + +import com.outsidesource.oskitkmp.interactor.Interactor +import com.outsidesource.oskitkmp.outcome.unwrapOrNull +import coordinator.AppCoordinator +import kotlinx.coroutines.launch + +data class OpenForResultExampleViewState( + val result: Boolean? = null, +) + +class OpenForResultExampleViewInteractor( + private val coordinator: AppCoordinator +): Interactor( + initialState = OpenForResultExampleViewState() +) { + + fun openConfirmationRouteClicked() { + interactorScope.launch { + val res = coordinator.openForResultExampleConfirmationClicked().unwrapOrNull() + update { state -> state.copy(result = res) } + } + } +} \ No newline at end of file From 2be095f023c3a032c7b8f07a06c209b6f7eb4c83 Mon Sep 17 00:00:00 2001 From: Dr Watson <> Date: Thu, 26 Jun 2025 15:24:33 +0300 Subject: [PATCH 2/3] PR feedback --- composeApp/src/commonMain/kotlin/DI.kt | 4 ++-- .../commonMain/kotlin/coordinator/AppCoordinator.kt | 2 +- composeApp/src/commonMain/kotlin/ui/app/App.kt | 4 ++-- .../src/commonMain/kotlin/ui/home/HomeScreen.kt | 8 ++++---- .../commonMain/kotlin/ui/home/HomeViewInteractor.kt | 2 +- ...onScreen.kt => OpenForResultConfirmationScreen.kt} | 11 +++++------ ....kt => OpenForResultConfirmationViewInteractor.kt} | 2 +- .../OpenForResultExampleScreen.kt | 4 +--- 8 files changed, 17 insertions(+), 20 deletions(-) rename composeApp/src/commonMain/kotlin/ui/openForResultExample/{ConfirmationScreen.kt => OpenForResultConfirmationScreen.kt} (80%) rename composeApp/src/commonMain/kotlin/ui/openForResultExample/{ConfirmationViewInteractor.kt => OpenForResultConfirmationViewInteractor.kt} (91%) diff --git a/composeApp/src/commonMain/kotlin/DI.kt b/composeApp/src/commonMain/kotlin/DI.kt index 06daa51..b8bffc1 100644 --- a/composeApp/src/commonMain/kotlin/DI.kt +++ b/composeApp/src/commonMain/kotlin/DI.kt @@ -22,7 +22,7 @@ import ui.device.DeviceHomeViewInteractor import ui.file.FileSystemViewInteractor import ui.home.HomeViewInteractor import ui.iosServices.IOSServicesScreenViewInteractor -import ui.openForResultExample.ConfirmationViewInteractor +import ui.openForResultExample.OpenForResultConfirmationViewInteractor import ui.openForResultExample.OpenForResultExampleViewInteractor import ui.popups.PopupsScreenViewInteractor import ui.viewStateExample.ViewStateExampleViewInteractor @@ -62,5 +62,5 @@ fun commonModule() = module { factory { CapabilityScreenViewInteractor(get()) } factory { ColorPickerViewInteractor() } factory { OpenForResultExampleViewInteractor(get()) } - factory { ConfirmationViewInteractor(get()) } + factory { OpenForResultConfirmationViewInteractor(get()) } } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt b/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt index de602cb..e796b06 100644 --- a/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt +++ b/composeApp/src/commonMain/kotlin/coordinator/AppCoordinator.kt @@ -38,7 +38,7 @@ class AppCoordinator(): Coordinator( fun htmlDemoClicked() = push(Route.WebDemo) fun windowInfoClicked() = push(Route.WindowInfo) fun openForResultExampleClicked() = push(Route.OpenForResultExample) - suspend fun openForResultExampleConfirmationClicked() = transactionWithResult(Boolean::class) { + suspend fun openForResultExampleConfirmationClicked() = transactionWithResult(Boolean::class) { push(Route.OpenForResultExampleConfirmation) } fun openForResultExampleConfirmationYesClicked() { diff --git a/composeApp/src/commonMain/kotlin/ui/app/App.kt b/composeApp/src/commonMain/kotlin/ui/app/App.kt index d44e678..ac4b2c7 100644 --- a/composeApp/src/commonMain/kotlin/ui/app/App.kt +++ b/composeApp/src/commonMain/kotlin/ui/app/App.kt @@ -23,7 +23,7 @@ import ui.markdown.MarkdownScreen import ui.popups.PopupsScreen import ui.viewStateExample.ViewStateExampleScreen import ui.htmlDemo.HtmlDemoScreen -import ui.openForResultExample.ConfirmationScreen +import ui.openForResultExample.OpenForResultConfirmationScreen import ui.openForResultExample.OpenForResultExampleScreen import ui.widgets.WidgetsScreen import ui.windowInfo.WindowInfoScreen @@ -65,7 +65,7 @@ fun App( } ) is Route.OpenForResultExample -> OpenForResultExampleScreen() - is Route.OpenForResultExampleConfirmation -> ConfirmationScreen() + is Route.OpenForResultExampleConfirmation -> OpenForResultConfirmationScreen() } } } diff --git a/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt b/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt index 1ea24f5..5391ec2 100644 --- a/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt +++ b/composeApp/src/commonMain/kotlin/ui/home/HomeScreen.kt @@ -102,6 +102,10 @@ fun HomeScreen( content = { Text("Window Info") }, onClick = interactor::windowInfoButtonClicked, ) + Button( + content = { Text("Open Route For Result Example") }, + onClick = interactor::openForResultClicked, + ) Button( content = { Text(rememberKmpString(Strings.iosServices)) }, onClick = interactor::iosServicesButtonClicked, @@ -112,10 +116,6 @@ fun HomeScreen( onClick = interactor::htmlDemoButtonClicked, enabled = Platform.current == Platform.WebBrowser, ) - Button( - content = { Text("Open Route For Result Example") }, - onClick = interactor::openForResultExampleClicked, - ) } } } diff --git a/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt b/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt index 8db3ca2..75d0045 100644 --- a/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt +++ b/composeApp/src/commonMain/kotlin/ui/home/HomeViewInteractor.kt @@ -19,5 +19,5 @@ class HomeViewInteractor( fun colorPickerButtonClicked() = coordinator.colorPickerClicked() fun htmlDemoButtonClicked() = coordinator.htmlDemoClicked() fun windowInfoButtonClicked() = coordinator.windowInfoClicked() - fun openForResultExampleClicked() = coordinator.openForResultExampleClicked() + fun openForResultClicked() = coordinator.openForResultExampleClicked() } \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultConfirmationScreen.kt similarity index 80% rename from composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt rename to composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultConfirmationScreen.kt index 0e6d780..3e62cf8 100644 --- a/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationScreen.kt +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultConfirmationScreen.kt @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.Button import androidx.compose.material.Text -import androidx.compose.material.TextField import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -16,8 +15,8 @@ import com.outsidesource.oskitcompose.lib.rememberInjectForRoute import ui.common.Screen @Composable -fun ConfirmationScreen( - interactor: ConfirmationViewInteractor = rememberInjectForRoute() +fun OpenForResultConfirmationScreen( + interactor: OpenForResultConfirmationViewInteractor = rememberInjectForRoute() ) { val state = interactor.collectAsState() @@ -27,17 +26,17 @@ fun ConfirmationScreen( verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically), horizontalAlignment = Alignment.CenterHorizontally, ) { - Text("Did you just sign in from a new device?") + Text("Return Result:") Row( horizontalArrangement = Arrangement.spacedBy(8.dp) ) { Button( - content = { Text("Yes, that was me") }, + content = { Text("True") }, onClick = interactor::yesClicked ) Button( - content = { Text("No, that's not me") }, + content = { Text("False") }, onClick = interactor::noClicked ) } diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultConfirmationViewInteractor.kt similarity index 91% rename from composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt rename to composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultConfirmationViewInteractor.kt index c726da9..61925fc 100644 --- a/composeApp/src/commonMain/kotlin/ui/openForResultExample/ConfirmationViewInteractor.kt +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultConfirmationViewInteractor.kt @@ -7,7 +7,7 @@ data class ConfirmationViewState( val result: Boolean? = null, ) -class ConfirmationViewInteractor( +class OpenForResultConfirmationViewInteractor( private val coordinator: AppCoordinator ): Interactor( initialState = ConfirmationViewState() diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt index 93d02fe..75c0fcb 100644 --- a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt @@ -38,9 +38,7 @@ fun OpenForResultExampleScreen( onClick = interactor::openConfirmationRouteClicked ) - if (state.result != null) { - Text("Returned result: ${if (state.result) "Yes" else "No"}") - } + Text("Returned result: ${state.result?.toString()?:"Cancelled"}") } } From 2eada2a722917d9b3bdf311983cb9b5841ce0069 Mon Sep 17 00:00:00 2001 From: Dr Watson <> Date: Thu, 26 Jun 2025 15:27:34 +0300 Subject: [PATCH 3/3] code reading --- .../ui/openForResultExample/OpenForResultExampleScreen.kt | 4 +++- .../OpenForResultExampleViewInteractor.kt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt index 75c0fcb..ecc47f9 100644 --- a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleScreen.kt @@ -38,7 +38,9 @@ fun OpenForResultExampleScreen( onClick = interactor::openConfirmationRouteClicked ) - Text("Returned result: ${state.result?.toString()?:"Cancelled"}") + if (state.exampleDialogWasEverLaunched) { + Text("Returned result: ${state.result?.toString() ?: "Cancelled"}") + } } } diff --git a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt index 85faef4..f09aca5 100644 --- a/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt +++ b/composeApp/src/commonMain/kotlin/ui/openForResultExample/OpenForResultExampleViewInteractor.kt @@ -7,6 +7,7 @@ import kotlinx.coroutines.launch data class OpenForResultExampleViewState( val result: Boolean? = null, + val exampleDialogWasEverLaunched: Boolean = false, ) class OpenForResultExampleViewInteractor( @@ -16,6 +17,7 @@ class OpenForResultExampleViewInteractor( ) { fun openConfirmationRouteClicked() { + update { state -> state.copy(exampleDialogWasEverLaunched = true) } interactorScope.launch { val res = coordinator.openForResultExampleConfirmationClicked().unwrapOrNull() update { state -> state.copy(result = res) }