Skip to content

Commit

Permalink
[REFACTOR/#35] toMutableSet() 사용 없이 요일 선택 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
DongChyeon committed Jan 14, 2025
1 parent 97d5a27 commit ae8c804
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class AlarmAddEditViewModel @Inject constructor() : BaseViewModel<AlarmAddEditCo
}

private fun toggleDaySelection(day: AlarmDay) {
val updatedDays = currentState.selectedDays.toMutableSet().apply {
if (contains(day)) remove(day) else add(day)
val updatedDays = if (day in currentState.selectedDays) {
currentState.selectedDays - day
} else {
currentState.selectedDays + day
}
val weekdays = setOf(AlarmDay.MON, AlarmDay.TUE, AlarmDay.WED, AlarmDay.THU, AlarmDay.FRI)
val weekends = setOf(AlarmDay.SAT, AlarmDay.SUN)
Expand Down

0 comments on commit ae8c804

Please sign in to comment.