fix: Fix a critical bug that caused the app to generate database entries in an infinite loop
This commit is contained in:
@@ -89,11 +89,9 @@ class TimerViewModel(
|
||||
val today = LocalDate.now()
|
||||
|
||||
// Fills dates between today and lastDate with 0s to ensure continuous history
|
||||
lastDate?.until(today)?.days?.let {
|
||||
while (it > 0) {
|
||||
lastDate = lastDate?.plusDays(1)
|
||||
statRepository.insertStat(Stat(lastDate!!, 0, 0, 0, 0, 0))
|
||||
}
|
||||
while ((lastDate?.until(today)?.days ?: -1) > 0) {
|
||||
lastDate = lastDate?.plusDays(1)
|
||||
statRepository.insertStat(Stat(lastDate!!, 0, 0, 0, 0, 0))
|
||||
}
|
||||
|
||||
delay(1500)
|
||||
|
||||
Reference in New Issue
Block a user