mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-09 18:48:51 -06:00
Fix incorrect streaks
This commit is contained in:
@@ -60,16 +60,13 @@ public class StreakList
|
||||
long day = DateHelper.millisecondsInOneDay;
|
||||
|
||||
Streak newestStreak = getNewest();
|
||||
if (newestStreak == null)
|
||||
if (newestStreak != null)
|
||||
{
|
||||
Repetition oldestRep = habit.repetitions.getOldest();
|
||||
if (oldestRep == null) return;
|
||||
|
||||
beginning = oldestRep.timestamp;
|
||||
beginning = newestStreak.start;
|
||||
}
|
||||
else
|
||||
{
|
||||
Repetition oldestRep = habit.repetitions.getOldestNewerThan(newestStreak.end);
|
||||
Repetition oldestRep = habit.repetitions.getOldest();
|
||||
if (oldestRep == null) return;
|
||||
|
||||
beginning = oldestRep.timestamp;
|
||||
@@ -96,6 +93,8 @@ public class StreakList
|
||||
|
||||
ActiveAndroid.beginTransaction();
|
||||
|
||||
if(newestStreak != null) newestStreak.delete();
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < list.size(); i += 2)
|
||||
|
||||
Reference in New Issue
Block a user