From bff96f6ae274a339e16ed93008faa5c7db328a95 Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Mon, 31 Jul 2023 22:37:55 +0200 Subject: [PATCH] change Meteor.user() to ReactiveCache.getCurrentUser() - see also: https://github.com/wekan/wekan/issues/5000 --- client/components/lists/list.js | 2 +- client/components/lists/listHeader.js | 2 +- client/components/swimlanes/swimlaneHeader.js | 2 +- client/components/swimlanes/swimlanes.js | 4 ++-- client/components/users/userHeader.js | 6 +++--- models/users.js | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/components/lists/list.js b/client/components/lists/list.js index a451c6b5b..c49f00780 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -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); }, diff --git a/client/components/lists/listHeader.js b/client/components/lists/listHeader.js index a8f63900a..c50772e9a 100644 --- a/client/components/lists/listHeader.js +++ b/client/components/lists/listHeader.js @@ -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() { diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js index 89398faee..2b1547500 100644 --- a/client/components/swimlanes/swimlaneHeader.js +++ b/client/components/swimlanes/swimlaneHeader.js @@ -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() { diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index fb190c157..09ff81db3 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -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(); }, }); diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 22fd808b4..41fe3d051 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -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; } diff --git a/models/users.js b/models/users.js index 4288111bc..44b012d29 100644 --- a/models/users.js +++ b/models/users.js @@ -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); }, });