Compare commits

2 Commits

View File

@@ -392,10 +392,13 @@ class PresetViewModel @Inject constructor(
val newRepetitionIndex = repetitionList.value.indexOf(repetition).takeIf { it != -1 } ?: 0 val newRepetitionIndex = repetitionList.value.indexOf(repetition).takeIf { it != -1 } ?: 0
val newRepetition = if (isUp == UpDownState.Up) { val newRepetition = if (isUp == UpDownState.Up) {
// Original logic: repetitionIndex < PulseDurations.size -1 (Likely a typo, should be Repetitions.size) // Original logic: repetitionIndex < PulseDurations.size -1 (Likely a typo, should be Repetitions.size)
if (newRepetitionIndex < repetitionList.value.size - 1) repetitionList.value[newRepetitionIndex + 1] else repetition if(newRepetitionIndex < repetitionList.value.size - 1) repetitionList.value[newRepetitionIndex + 1]
} else { else repetition
}
else {
// Original logic: repetitionIndex > 1 // Original logic: repetitionIndex > 1
if (newRepetitionIndex > 0) repetitionList.value[newRepetitionIndex - 1] else repetition if (newRepetitionIndex > 0) repetitionList.value[newRepetitionIndex - 1]
else repetition
} }
val updatedPreset = currentList[index].copy(repetition = newRepetition) val updatedPreset = currentList[index].copy(repetition = newRepetition)