mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Fix position for new habits
This commit is contained in:
@@ -83,7 +83,7 @@ public class Habit extends Model
|
|||||||
public Habit()
|
public Habit()
|
||||||
{
|
{
|
||||||
this.color = ColorHelper.palette[5];
|
this.color = ColorHelper.palette[5];
|
||||||
this.position = Habit.count();
|
this.position = Habit.countWithArchived();
|
||||||
this.highlight = 0;
|
this.highlight = 0;
|
||||||
this.archived = 0;
|
this.archived = 0;
|
||||||
this.freqDen = 7;
|
this.freqDen = 7;
|
||||||
@@ -132,6 +132,11 @@ public class Habit extends Model
|
|||||||
return select().count();
|
return select().count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int countWithArchived()
|
||||||
|
{
|
||||||
|
return selectWithArchived().count();
|
||||||
|
}
|
||||||
|
|
||||||
public static java.util.List<Habit> getHighlightedHabits()
|
public static java.util.List<Habit> getHighlightedHabits()
|
||||||
{
|
{
|
||||||
return select().where("highlight = 1")
|
return select().where("highlight = 1")
|
||||||
|
|||||||
Reference in New Issue
Block a user