summaryrefslogtreecommitdiffstats
path: root/client/components/main
diff options
context:
space:
mode:
authorguillaume <guillaume.cassou@supinfo.com>2018-12-19 17:22:16 +0100
committerguillaume <guillaume.cassou@supinfo.com>2018-12-19 17:22:16 +0100
commitff1c3722a87768378632e368bfe2c27cddd9ec23 (patch)
tree1b7444cb0e52596de20924b4abed3d5e220fa7da /client/components/main
parent1712368f6a1ec07bad2c1edb17ae480397e0f45f (diff)
downloadwekan-ff1c3722a87768378632e368bfe2c27cddd9ec23.tar.gz
wekan-ff1c3722a87768378632e368bfe2c27cddd9ec23.tar.bz2
wekan-ff1c3722a87768378632e368bfe2c27cddd9ec23.zip
Patch currentBoard doesn't exist when logout
Diffstat (limited to 'client/components/main')
-rwxr-xr-xclient/components/main/editor.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index 20ece562..8ea73793 100755
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -9,10 +9,12 @@ Template.editor.onRendered(() => {
match: /\B@([\w.]*)$/,
search(term, callback) {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
- callback(currentBoard.activeMembers().map((member) => {
- const username = Users.findOne(member.userId).username;
- return username.includes(term) ? username : null;
- }).filter(Boolean));
+ if (currentBoard) {
+ callback(currentBoard.activeMembers().map((member) => {
+ const username = Users.findOne(member.userId).username;
+ return username.includes(term) ? username : null;
+ }).filter(Boolean));
+ }
},
template(value) {
return value;
@@ -37,6 +39,9 @@ const at = HTML.CharRef({html: '&commat;', str: '@'});
Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
const view = this;
const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ if (!currentBoard) {
+ return HTML.Raw("");
+ }
const knowedUsers = currentBoard.members.map((member) => {
const u = Users.findOne(member.userId);
if(u){