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) 🍒 (#3386)

Co-authored-by: Yamil Medina <[email protected]>
  • Loading branch information
github-actions[bot] and yamilmedina committed Aug 27, 2024
1 parent 8fa1f4f commit b7bc3df
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 @@ -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()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ class ConnectionActionButtonViewModelTest {
}
verify { arrangement.onOpenConversation(any()) }
verify { arrangement.onMissingKeyPackages wasNot Called }
assertEquals(false, viewModel.actionableState().isPerformingAction)
}

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

@Test
Expand All @@ -313,6 +315,7 @@ class ConnectionActionButtonViewModelTest {
}
verify { arrangement.onOpenConversation wasNot Called }
verify { arrangement.onMissingKeyPackages() }
assertEquals(false, viewModel.actionableState().isPerformingAction)
}

companion object {
Expand Down

0 comments on commit b7bc3df

Please sign in to comment.