diff --git a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt index 1c6eec7bd56..3c24862f4b1 100644 --- a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt @@ -202,9 +202,11 @@ class ConnectionActionButtonViewModelImpl @Inject constructor( if (result.coreFailure is CoreFailure.MissingKeyPackages) onMissingKeyPackages() } - is CreateConversationResult.Success -> onSuccess(result.conversation.id) + is CreateConversationResult.Success -> { + state = state.finishAction() + onSuccess(result.conversation.id) + } } - state.finishAction() } } diff --git a/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt index 1ca42505d07..58f1e3be4c8 100644 --- a/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt @@ -275,6 +275,7 @@ class ConnectionActionButtonViewModelTest { } verify { arrangement.onOpenConversation(any()) } verify { arrangement.onMissingKeyPackages wasNot Called } + assertEquals(false, viewModel.actionableState().isPerformingAction) } @Test @@ -294,6 +295,7 @@ class ConnectionActionButtonViewModelTest { } verify { arrangement.onOpenConversation wasNot Called } verify { arrangement.onMissingKeyPackages wasNot Called } + assertEquals(false, viewModel.actionableState().isPerformingAction) } @Test @@ -313,6 +315,7 @@ class ConnectionActionButtonViewModelTest { } verify { arrangement.onOpenConversation wasNot Called } verify { arrangement.onMissingKeyPackages() } + assertEquals(false, viewModel.actionableState().isPerformingAction) } companion object {