Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: button keeps spinning when user starts a conversation and back (WPB-5862) 🍒 #3386

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading