Merge pull request #5490 from mfilser/master

change Meteor.user() to ReactiveCache.getCurrentUser()
This commit is contained in:
Lauri Ojansivu 2024-08-06 23:35:07 +03:00 committed by GitHub
commit b6ce81dc79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 10 additions and 13 deletions

View file

@ -196,7 +196,7 @@ BlazeComponent.extendComponent({
},
listWidth() {
const user = Meteor.user();
const user = ReactiveCache.getCurrentUser();
const list = Template.currentData();
return user.getListWidth(list.boardId, list._id);
},

View file

@ -362,7 +362,7 @@ BlazeComponent.extendComponent({
listWidthValue() {
const list = Template.currentData();
const board = list.boardId;
return Meteor.user().getListWidth(board, list._id);
return ReactiveCache.getCurrentUser().getListWidth(board, list._id);
},
events() {

View file

@ -224,7 +224,7 @@ BlazeComponent.extendComponent({
swimlaneHeightValue() {
const swimlane = this.currentData();
const board = swimlane.boardId;
return Meteor.user().getSwimlaneHeight(board, swimlane._id);
return ReactiveCache.getCurrentUser().getSwimlaneHeight(board, swimlane._id);
},
events() {

View file

@ -225,7 +225,7 @@ BlazeComponent.extendComponent({
},
swimlaneHeight() {
const user = Meteor.user();
const user = ReactiveCache.getCurrentUser();
const swimlane = Template.currentData();
const height = user.getSwimlaneHeight(swimlane.boardId, swimlane._id);
return height == -1 ? "auto" : (height + "px");
@ -288,7 +288,7 @@ BlazeComponent.extendComponent({
Template.swimlane.helpers({
canSeeAddList() {
return Meteor.user().isBoardAdmin();
return ReactiveCache.getCurrentUser().isBoardAdmin();
},
});

View file

@ -325,7 +325,7 @@ Template.changeSettingsPopup.helpers({
});
},
startDayOfWeek() {
currentUser = Meteor.user();
currentUser = ReactiveCache.getCurrentUser();
if (currentUser) {
return currentUser.getStartDayOfWeek();
} else {
@ -343,7 +343,7 @@ Template.changeSettingsPopup.events({
return ret;
},
'click .js-toggle-desktop-drag-handles'() {
currentUser = Meteor.user();
const currentUser = ReactiveCache.getCurrentUser();
if (currentUser) {
Meteor.call('toggleDesktopDragHandles');
} else if (window.localStorage.getItem('showDesktopDragHandles')) {
@ -375,7 +375,7 @@ Template.changeSettingsPopup.events({
templateInstance.$('#start-day-of-week').val(),
10,
);
const currentUser = Meteor.user();
const currentUser = ReactiveCache.getCurrentUser();
if (isNaN(minLimit) || minLimit < -1) {
minLimit = -1;
}

View file

@ -128,9 +128,6 @@ ReactiveCacheServer = {
return ret;
},
getUsers(selector = {}, options = {}, getQuery = false) {
// getUsers(selector, options, getQuery) {
// let ret = Users.find(undefined, {});
// console.log("getUser count: ", ret.count())
let ret = Users.find(selector, options);
if (getQuery !== true) {
ret = ret.fetch();

View file

@ -1248,14 +1248,14 @@ Meteor.methods({
check(boardId, String);
check(listId, String);
check(width, Number);
const user = Meteor.user();
const user = ReactiveCache.getCurrentUser();
user.setListWidth(boardId, listId, width);
},
applySwimlaneHeight(boardId, swimlaneId, height) {
check(boardId, String);
check(swimlaneId, String);
check(height, Number);
const user = Meteor.user();
const user = ReactiveCache.getCurrentUser();
user.setSwimlaneHeight(boardId, swimlaneId, height);
},
});