Skip to content

Commit

Permalink
fix: button keeps spinning when user starts a conversation and back (…
Browse files Browse the repository at this point in the history
…WPB-5862) (#3372)
  • Loading branch information
yamilmedina authored Aug 27, 2024
1 parent 97f6b70 commit ac07dd4
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 ac07dd4

Please sign in to comment.