@@ -111,7 +111,7 @@ BlazeComponent.extendComponent({
title,
checklistId: checklist._id,
cardId: checklist.cardId,
- sort: checklist.itemCount(),
+ sort: Utils.calculateIndexData(checklist.lastItem()).base,
});
}
// We keep the form opened, empty it.
@@ -91,6 +91,11 @@ Checklists.helpers({
{ sort: ['sort'] },
);
},
+ lastItem() {
+ const allItems = this.items().fetch();
+ const ret = allItems[allItems.length - 1];
+ return ret;
+ },
finishedCount() {
return ChecklistItems.find({
checklistId: this._id,