test: cover delete flows and guard re-entrant mutations
This commit is contained in:
@@ -153,6 +153,9 @@ class BoardDetailViewModel(
|
||||
|
||||
fun submitRenameList() {
|
||||
val snapshot = _uiState.value
|
||||
if (snapshot.isMutating) {
|
||||
return
|
||||
}
|
||||
val editingListId = snapshot.editingListId ?: return
|
||||
val currentList = snapshot.boardDetail?.lists?.firstOrNull { it.id == editingListId } ?: return
|
||||
val trimmedTitle = snapshot.editingListTitle.trim()
|
||||
@@ -238,6 +241,9 @@ class BoardDetailViewModel(
|
||||
mutation: suspend (Set<String>) -> CardBatchMutationResult,
|
||||
) {
|
||||
val preMutation = _uiState.value
|
||||
if (preMutation.isMutating) {
|
||||
return
|
||||
}
|
||||
val selectedIds = preMutation.selectedCardIds
|
||||
if (selectedIds.isEmpty()) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user