Only increase daily streak if task is checked off.

This commit is contained in:
Phillip Thelen 2018-10-09 10:49:48 +02:00 committed by GitHub
parent 1d9eb05453
commit 25eabb1bef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,7 +90,7 @@ class TaskRepositoryImpl(localRepository: TaskLocalRepository, apiClient: ApiCli
task.value = task.value + res.delta
if (Task.TYPE_DAILY == task.type || Task.TYPE_TODO == task.type) {
task.completed = up
if (Task.TYPE_DAILY == task.type) {
if (Task.TYPE_DAILY == task.type && up) {
task.streak = (task.streak ?: 0) + 1
}
} else if (Task.TYPE_HABIT == task.type) {