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 newRepetition = if (isUp == UpDownState.Up) {
// 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
} else {
if(newRepetitionIndex < repetitionList.value.size - 1) repetitionList.value[newRepetitionIndex + 1]
else repetition
}
else {
// 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)