Improved new user experience and fixed errors on character delete

This commit is contained in:
Stefan Zermatten
2017-09-28 13:03:54 +02:00
parent c4e77c7eae
commit 4c31ab601c
11 changed files with 25 additions and 15 deletions

View File

@@ -3,7 +3,8 @@ Template.registerHelper("canEditCharacter", function(charId) {
});
canEditCharacter = function(charId) {
var char = Characters.findOne(charId)
var char = Characters.findOne(charId);
if (!char) return false;
var userId = Meteor.userId();
return char.owner === userId ||
_.contains(char.writers, userId);