small bug fixes

This commit is contained in:
Sacha Greif 2016-06-06 16:11:51 +09:00
parent 0d28817ac0
commit 7a3a467fbc
3 changed files with 8 additions and 6 deletions

View file

@ -147,7 +147,7 @@ twitter@1.1.9
ui@1.0.11
underscore@1.0.8
url@1.0.9
utilities:react-list-container@0.1.11
utilities:react-list-container@0.1.12
utilities:smart-methods@0.1.4
utilities:smart-publications@0.1.4
webapp@1.2.8

View file

@ -121,13 +121,15 @@ Campaign.build = function (postsArray) {
if (post.categories) {
properties.categories = post.categories.map(categoryID => {
const category = Categories.findOne(categoryID);
if (category) {
return {
name: category.name,
url: Categories.getUrl(category, true)
}
}
});
}
console.log(properties)
// console.log(properties)
// generate post item HTML and add it to the postsHTML string
postsHTML += Telescope.email.getTemplate('postItem')(properties);
});

View file

@ -69,12 +69,12 @@ Meteor.publish('posts.list', function (terms) {
// this.unblock(); // causes bug where publication returns 0 results
this.autorun(function () {
const currentUser = Meteor.users.findOne(this.userId);
terms.currentUserId = this.userId; // add currentUserId to terms
const {selector, options} = Posts.parameters.get(terms);
// note: enabling Counts.publish messes up SSR
Counts.publish(this, terms.listId, Posts.find(selector, options), {noReady: true});
options.fields = Posts.publishedFields.list;