Use database when logged in. Continued.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2019-11-19 21:55:43 +02:00
parent 975258ef39
commit 115d23f929
5 changed files with 19 additions and 17 deletions

View file

@ -199,7 +199,8 @@ BlazeComponent.extendComponent({
let showDesktopDragHandles = false;
currentUser = Meteor.user();
if (currentUser) {
showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles;
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
if (cookies.has('showDesktopDragHandles')) {
showDesktopDragHandles = true;

View file

@ -122,7 +122,8 @@ BlazeComponent.extendComponent({
let showDesktopDragHandles = false;
currentUser = Meteor.user();
if (currentUser) {
showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles;
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
if (cookies.has('showDesktopDragHandles')) {
showDesktopDragHandles = true;

View file

@ -713,13 +713,11 @@ BlazeComponent.extendComponent({
.data()._id;
}
}
} else {
if (Utils.boardView() === 'board-view-swimlanes') {
this.swimlaneId = this.parentComponent()
.parentComponent()
.parentComponent()
.data()._id;
}
} else if (Utils.boardView() === 'board-view-swimlanes') {
this.swimlaneId = this.parentComponent()
.parentComponent()
.parentComponent()
.data()._id;
}
},

View file

@ -102,7 +102,8 @@ function initSortable(boardComponent, $listsDom) {
let showDesktopDragHandles = false;
currentUser = Meteor.user();
if (currentUser) {
showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles;
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
import { Cookies } from 'meteor/ostrio:cookies';
const cookies = new Cookies();
@ -203,7 +204,8 @@ BlazeComponent.extendComponent({
let showDesktopDragHandles = false;
currentUser = Meteor.user();
if (currentUser) {
showDesktopDragHandles = (currentUser.profile || {}).showDesktopDragHandles;
showDesktopDragHandles = (currentUser.profile || {})
.showDesktopDragHandles;
} else {
import { Cookies } from 'meteor/ostrio:cookies';
const cookies = new Cookies();

View file

@ -10,9 +10,9 @@ Utils = {
cookies.set('boardView', 'board-view-lists'); //true
} else if (view === 'board-view-swimlanes') {
cookies.set('boardView', 'board-view-swimlanes'); //true
//} else if (view === 'board-view-collapse') {
// cookies.set('boardView', 'board-view-swimlane'); //true
// cookies.set('collapseSwimlane', 'true'); //true
//} else if (view === 'board-view-collapse') {
// cookies.set('boardView', 'board-view-swimlane'); //true
// cookies.set('collapseSwimlane', 'true'); //true
} else if (view === 'board-view-cal') {
cookies.set('boardView', 'board-view-cal'); //true
}
@ -29,7 +29,7 @@ Utils = {
boardView() {
currentUser = Meteor.user();
if (currentUser) {
return (currentUser.profile || {}).boardView
return (currentUser.profile || {}).boardView;
} else {
import { Cookies } from 'meteor/ostrio:cookies';
const cookies = new Cookies();
@ -40,8 +40,8 @@ Utils = {
//&& !cookies.has('collapseSwimlane')
) {
return 'board-view-swimlanes';
//} else if (cookies.has('collapseSwimlane')) {
// return 'board-view-swimlanes';
//} else if (cookies.has('collapseSwimlane')) {
// return 'board-view-swimlanes';
} else if (cookies.get('boardView') === 'board-view-cal') {
return 'board-view-cal';
} else {