merge master

This commit is contained in:
riley
2017-05-16 16:33:41 -06:00
219 changed files with 3845 additions and 1847 deletions
+4 -8
View File
@@ -120,8 +120,8 @@ const getParentCountByAssetIDPersonalized = async (context, {assetId, excludeIgn
const ignoredUsers = freshUser.ignoresUsers;
query.author_id = {$nin: ignoredUsers};
}
const count = await CommentModel.where(query).count();
return count;
return CommentModel.where(query).count();
};
/**
@@ -263,13 +263,9 @@ const getCommentsByQuery = async ({user}, {ids, statuses, asset_id, parent_id, a
comments = comments.where({parent_id});
}
if (excludeIgnored && user) {
// load afresh, as `user` may be from cache and not have recent ignores
const freshUser = await UsersService.findById(user.id);
const ignoredUsers = freshUser.ignoresUsers;
if (excludeIgnored && user && user.ignoresUsers) {
comments = comments.where({
author_id: {$nin: ignoredUsers}
author_id: {$nin: user.ignoresUsers}
});
}