Move every Lists.findOne() to the ReactiveCache

This commit is contained in:
Martin Filser 2023-01-14 19:33:36 +01:00
parent 06e26d8d89
commit 0926943670
9 changed files with 17 additions and 16 deletions

View file

@ -26,7 +26,7 @@ Activities.helpers({
return Users.findOne(this.memberId);
},
list() {
return Lists.findOne(this.listId);
return ReactiveCache.getList(this.listId);
},
swimlane() {
return Swimlanes.findOne(this.swimlaneId);
@ -35,7 +35,7 @@ Activities.helpers({
return Swimlanes.findOne(this.oldSwimlaneId);
},
oldList() {
return Lists.findOne(this.oldListId);
return ReactiveCache.getList(this.oldListId);
},
card() {
return ReactiveCache.getCard(this.cardId);

View file

@ -1176,7 +1176,7 @@ Boards.helpers({
},
getDefaultSubtasksList() {
return Lists.findOne(this.getDefaultSubtasksListId());
return ReactiveCache.getList(this.getDefaultSubtasksListId());
},
getDefaultDateSettingsListId() {
@ -1194,7 +1194,7 @@ Boards.helpers({
},
getDefaultDateSettingsList() {
return Lists.findOne(this.getDefaultDateSettingsListId());
return ReactiveCache.getList(this.getDefaultDateSettingsListId());
},
getDefaultSwimline() {

View file

@ -274,7 +274,7 @@ Lists.helpers({
},
getWipLimit(option) {
const list = Lists.findOne({ _id: this._id });
const list = ReactiveCache.getList(this._id);
if (!list.wipLimit) {
// Necessary check to avoid exceptions for the case where the doc doesn't have the wipLimit field yet set
return 0;
@ -389,12 +389,12 @@ Meteor.methods({
if (limit === 0) {
limit = 1;
}
Lists.findOne({ _id: listId }).setWipLimit(limit);
ReactiveCache.getList(listId).setWipLimit(limit);
},
enableWipLimit(listId) {
check(listId, String);
const list = Lists.findOne({ _id: listId });
const list = ReactiveCache.getList(listId);
if (list.getWipLimit('value') === 0) {
list.setWipLimit(1);
}
@ -403,7 +403,7 @@ Meteor.methods({
enableSoftLimit(listId) {
check(listId, String);
const list = Lists.findOne({ _id: listId });
const list = ReactiveCache.getList(listId);
list.toggleSoftLimit(!list.getWipLimit('soft'));
},

View file

@ -47,11 +47,11 @@ Triggers.helpers({
},
fromList() {
return Lists.findOne(this.fromId);
return ReactiveCache.getList(this.fromId);
},
toList() {
return Lists.findOne(this.toId);
return ReactiveCache.getList(this.toId);
},
findList(title) {