From 512b362615c653acec531ffed60eb0fa38fcb192 Mon Sep 17 00:00:00 2001 From: ganfra Date: Tue, 22 Oct 2024 16:16:43 +0200 Subject: [PATCH] knock : close screen when canceling knock --- .../io/element/android/features/joinroom/impl/JoinRoomNode.kt | 1 + .../io/element/android/features/joinroom/impl/JoinRoomView.kt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomNode.kt b/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomNode.kt index c6ebb1b8b5..44f4d8def0 100644 --- a/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomNode.kt +++ b/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomNode.kt @@ -43,6 +43,7 @@ class JoinRoomNode @AssistedInject constructor( state = state, onBackClick = ::navigateUp, onJoinSuccess = ::navigateUp, + onCancelKnockSuccess = ::navigateUp, onKnockSuccess = { }, modifier = modifier ) diff --git a/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt b/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt index 8acfc17b4a..fbbe019537 100644 --- a/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt +++ b/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt @@ -80,6 +80,7 @@ fun JoinRoomView( onBackClick: () -> Unit, onJoinSuccess: () -> Unit, onKnockSuccess: () -> Unit, + onCancelKnockSuccess: () -> Unit, modifier: Modifier = Modifier, ) { Box( @@ -139,7 +140,7 @@ fun JoinRoomView( ) AsyncActionView( async = state.cancelKnockAction, - onSuccess = { state.eventSink(JoinRoomEvents.ClearActionStates) }, + onSuccess = { onCancelKnockSuccess() }, onErrorDismiss = { state.eventSink(JoinRoomEvents.ClearActionStates) }, confirmationDialog = { ConfirmationDialog( @@ -464,5 +465,6 @@ internal fun JoinRoomViewPreview(@PreviewParameter(JoinRoomStateProvider::class) onBackClick = { }, onJoinSuccess = { }, onKnockSuccess = { }, + onCancelKnockSuccess = { }, ) }