Skip to content

Commit

Permalink
[fix] #61 QA Delete Event 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
beom84 committed Jan 23, 2025
1 parent 37b10cb commit fe15454
Showing 1 changed file with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,32 +194,11 @@ constructor(
TodoContract.TodoEvent.OnItemDeleteButtonClicked -> {
viewModelScope.launch {
postDeletedItemList(selectedItemList = currentUiState.selectedItemList)
initDataLoad()
}
updateState(
TodoContract.TodoReduce.UpdateToDoCount(
completeCount = currentUiState.completeCount,
remainingStudyCount = currentUiState.remainingStudyCount - currentUiState.selectedItemList.size,
),
)
updateState(
TodoContract.TodoReduce.UpdatePendingToDoCount(
pendingCount = currentUiState.pendingCount + currentUiState.selectedItemList.size,
),
)

if (currentUiState.completeCount > 0 || currentUiState.remainingStudyCount - currentUiState.selectedItemList.size != 0) {
updateState(TodoContract.TodoReduce.DeleteToDoListItems)
updateState(
TodoContract.TodoReduce.UpdateToDoListCardState(
previousCardState = BbangZipCardState.CHECKABLE,
nextCardState = BbangZipCardState.DEFAULT,
),
)
updateState(TodoContract.TodoReduce.UpdateScreenType(screenType = ToDoScreenType.DEFAULT))
} else {
if (currentUiState.completeCount == 0 || currentUiState.remainingStudyCount - currentUiState.selectedItemList.size != 0) {
updateState(TodoContract.TodoReduce.UpdateScreenType(screenType = ToDoScreenType.EMPTY))
}

updateState(TodoContract.TodoReduce.ResetSelectedItemList)
setSideEffect(TodoContract.TodoSideEffect.ShowSnackBar("오늘 할 공부를 삭제했어요"))
}
Expand Down

0 comments on commit fe15454

Please sign in to comment.