Merge pull request #608 from KristianTashkov/kris/fix_yes_no

Only save numerical habit features if the habit is numerical
This commit is contained in:
2020-08-04 07:29:50 -05:00
committed by GitHub

View File

@@ -214,9 +214,11 @@ class EditHabitActivity : AppCompatActivity() {
habit.setReminder(Reminder(reminderHour, reminderMin, reminderDays))
}
habit.frequency = Frequency(freqNum, freqDen)
habit.targetValue = targetInput.text.toString().toDouble()
habit.targetType = Habit.AT_LEAST
habit.unit = unitInput.text.trim().toString()
if (habitType == Habit.NUMBER_HABIT) {
habit.targetValue = targetInput.text.toString().toDouble()
habit.targetType = Habit.AT_LEAST
habit.unit = unitInput.text.trim().toString()
}
habit.type = habitType
val command = if (habitId >= 0) {