Skip to content

Commit

Permalink
fix: the eternal spin of the conneciton button
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina committed Aug 26, 2024
1 parent 97f6b70 commit 916eda4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,11 @@ class ConnectionActionButtonViewModelImpl @Inject constructor(
onFailure(result.coreFailure)
}

is CreateConversationResult.Success -> onSuccess(result.conversation.id)
is CreateConversationResult.Success -> {
state = state.finishAction()
onSuccess(result.conversation.id)
}
}
state.finishAction()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ class ConnectionActionButtonViewModelTest {
}
verify { arrangement.onOpenConversation(any()) }
verify { arrangement.onStartConversationError wasNot Called }
assertEquals(false, viewModel.actionableState().isPerformingAction)
}

@Test
Expand All @@ -275,6 +276,7 @@ class ConnectionActionButtonViewModelTest {
}
verify { arrangement.onOpenConversation wasNot Called }
verify { arrangement.onStartConversationError(eq(failure)) }
assertEquals(false, viewModel.actionableState().isPerformingAction)
}

@Test
Expand All @@ -295,6 +297,7 @@ class ConnectionActionButtonViewModelTest {
}
verify { arrangement.onOpenConversation wasNot Called }
verify { arrangement.onStartConversationError(eq(errorResult)) }
assertEquals(false, viewModel.actionableState().isPerformingAction)
}

companion object {
Expand Down

0 comments on commit 916eda4

Please sign in to comment.