diff --git a/client/components/boards/boardArchive.js b/client/components/boards/boardArchive.js index ca80a694b..aa1ee7eda 100644 --- a/client/components/boards/boardArchive.js +++ b/client/components/boards/boardArchive.js @@ -25,8 +25,8 @@ BlazeComponent.extendComponent({ Meteor.settings && Meteor.settings.public && Meteor.settings.public.sandstorm; - if (isSandstorm && Session.get('currentBoard')) { - const currentBoard = Boards.findOne(Session.get('currentBoard')); + if (isSandstorm && Utils.getCurrentBoardId()) { + const currentBoard = Utils.getCurrentBoard(); currentBoard.archive(); } const board = this.currentData(); @@ -39,8 +39,8 @@ BlazeComponent.extendComponent({ Meteor.settings && Meteor.settings.public && Meteor.settings.public.sandstorm; - if (isSandstorm && Session.get('currentBoard')) { - const currentBoard = Boards.findOne(Session.get('currentBoard')); + if (isSandstorm && Utils.getCurrentBoardId()) { + const currentBoard = Utils.getCurrentBoard(); Boards.remove(currentBoard._id); } Boards.remove(this._id); diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 2ed40bbe7..658c5e235 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -43,7 +43,7 @@ BlazeComponent.extendComponent({ this.mouseHasEnterCardDetails = false; // fix swimlanes sort field if there are null values - const currentBoardData = Boards.findOne(Session.get('currentBoard')); + const currentBoardData = Utils.getCurrentBoard(); const nullSortSwimlanes = currentBoardData.nullSortSwimlanes(); if (nullSortSwimlanes.count() > 0) { const swimlanes = currentBoardData.swimlanes(); @@ -214,7 +214,7 @@ BlazeComponent.extendComponent({ // If there is no data in the board (ie, no lists) we autofocus the list // creation form by clicking on the corresponding element. - const currentBoard = Boards.findOne(Session.get('currentBoard')); + const currentBoard = Utils.getCurrentBoard(); if (Utils.canModifyBoard() && currentBoard.lists().count() === 0) { boardComponent.openNewListForm(); } @@ -222,7 +222,7 @@ BlazeComponent.extendComponent({ notDisplayThisBoard() { let allowPrivateVisibilityOnly = TableVisibilityModeSettings.findOne('tableVisibilityMode-allowPrivateOnly'); - let currentBoard = Boards.findOne(Session.get('currentBoard')); + let currentBoard = Utils.getCurrentBoard(); if (allowPrivateVisibilityOnly !== undefined && allowPrivateVisibilityOnly.booleanValue && currentBoard.permission == 'public') { return true; } @@ -342,7 +342,7 @@ BlazeComponent.extendComponent({ }, locale: TAPi18n.getLanguage(), events(start, end, timezone, callback) { - const currentBoard = Boards.findOne(Session.get('currentBoard')); + const currentBoard = Utils.getCurrentBoard(); const events = []; const pushEvent = function (card, title, start, end, extraCls) { start = start || card.startAt; @@ -416,7 +416,7 @@ BlazeComponent.extendComponent({ } }, select: function(startDate) { - const currentBoard = Boards.findOne(Session.get('currentBoard')); + const currentBoard = Utils.getCurrentBoard(); const currentUser = Meteor.user(); const $modal = $(`